home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / DShowIDL / dxtrans.idl < prev    next >
Text File  |  2001-10-08  |  85KB  |  2,322 lines

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Copyright Microsoft Corporation 1997-2001
  4. //  All rights reserved.
  5. //
  6. //  File:   dxtrans.idl
  7. //
  8. //  Overview:
  9. //      This is the IDL file for DirectX installable transform coclass, 
  10. //      interface, and type definitions.
  11. //
  12. //------------------------------------------------------------------------------
  13.  
  14. cpp_quote("#include <servprov.h>")
  15. cpp_quote("#include <ddraw.h>")
  16. cpp_quote("#include <d3d.h>")
  17. cpp_quote("#include <d3drm.h>")
  18. cpp_quote("#include <urlmon.h>")
  19.  
  20. //--- Import base idl
  21. import "oaidl.idl";
  22. import "ocidl.idl";
  23. import "servprov.idl";
  24. import "comcat.idl";
  25.  
  26. //
  27. //  Since direct draw does not have an IDL, we'll define DDSURFACEDESC to
  28. //  be a void, but include ddraw.h in the header file.  This makes MIDL happy.
  29. //
  30. #ifndef DDSURFACEDESC
  31. cpp_quote("#if 0")
  32. cpp_quote("// Bogus definition used to make MIDL compiler happy")
  33. typedef void DDSURFACEDESC;
  34. typedef void D3DRMBOX;
  35. typedef void D3DVECTOR;
  36. typedef void D3DRMMATRIX4D;
  37. typedef void* LPSECURITY_ATTRIBUTES;
  38. cpp_quote("#endif")
  39. #endif
  40. //--- Additional includes
  41.  
  42. //--- Export
  43. cpp_quote( "#ifdef _DXTRANSIMPL")
  44. cpp_quote( "    #define _DXTRANS_IMPL_EXT _declspec(dllexport)")
  45. cpp_quote( "#else")
  46. cpp_quote( "    #define _DXTRANS_IMPL_EXT _declspec(dllimport)")
  47. cpp_quote( "#endif")
  48.  
  49. //=== Forward References ====================================================
  50. interface IDXTransformFactory;
  51. interface IDXTransform;
  52. interface IDXTaskManager;
  53. interface IDXSurfaceFactory;
  54. interface IDXSurface;
  55. interface IDXARGBSurfaceInit;
  56. interface IDXRawSurface;
  57. interface IDXARGBReadPtr;
  58. interface IDXARGBReadWritePtr;
  59. interface IDXDCLock;
  60. interface IDXTScale;
  61. interface IDXLookupTable;
  62. interface IDXTBindHost;
  63. interface IBindHost;
  64. interface IDXTScaleOutput;
  65. interface IDXGradient;
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. //
  69. //  Windows XP vs. DirectX 8.0 header merge
  70. //
  71. //  Separate the updated Windows XP version of this header from the downlevel
  72. //  version that shipped with the DirectX 8.0 SDK.  Since development 
  73. //  on BDA technology continued for Windows XP, some changes were made to
  74. //  this file in order to improve the interface and functionality.
  75. //
  76. //  To maintain compatibility with older applications which rely on the
  77. //  DirectX 8.0 versions of these files, the DirectX 8.1 version includes
  78. //  both the Windows XP content and the DirectX 8.0 content, which are 
  79. //  separated by the #if (WINVER >= 0x501) preprocessor directive.
  80. //
  81. //  Therefore, if you define WINVER to be 0x501 to specify Windows XP,
  82. //  the revised content will be compiled.  Otherwise, the original 
  83. //  DirectX 8.0 content will be used.
  84. //
  85. /////////////////////////////////////////////////////////////////////////////
  86.  
  87. #if (WINVER >= 0x501)    // Windows XP content
  88.  
  89.  
  90.  
  91. //=== Constants =============================================================
  92.  
  93. cpp_quote("//")
  94. cpp_quote("//   All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory")
  95. cpp_quote("//")
  96. cpp_quote("EXTERN_C const GUID DDPF_RGB1;") 
  97. cpp_quote("EXTERN_C const GUID DDPF_RGB2;") 
  98. cpp_quote("EXTERN_C const GUID DDPF_RGB4;") 
  99. cpp_quote("EXTERN_C const GUID DDPF_RGB8;") 
  100. cpp_quote("EXTERN_C const GUID DDPF_RGB332;") 
  101. cpp_quote("EXTERN_C const GUID DDPF_ARGB4444;") 
  102. cpp_quote("EXTERN_C const GUID DDPF_RGB565;") 
  103. cpp_quote("EXTERN_C const GUID DDPF_BGR565;") 
  104. cpp_quote("EXTERN_C const GUID DDPF_RGB555;") 
  105. cpp_quote("EXTERN_C const GUID DDPF_ARGB1555;") 
  106. cpp_quote("EXTERN_C const GUID DDPF_RGB24;") 
  107. cpp_quote("EXTERN_C const GUID DDPF_BGR24;") 
  108. cpp_quote("EXTERN_C const GUID DDPF_RGB32;") 
  109. cpp_quote("EXTERN_C const GUID DDPF_BGR32;") 
  110. cpp_quote("EXTERN_C const GUID DDPF_ABGR32;") 
  111. cpp_quote("EXTERN_C const GUID DDPF_ARGB32;") 
  112. cpp_quote("EXTERN_C const GUID DDPF_PMARGB32;") 
  113. cpp_quote("EXTERN_C const GUID DDPF_A1;") 
  114. cpp_quote("EXTERN_C const GUID DDPF_A2;") 
  115. cpp_quote("EXTERN_C const GUID DDPF_A4;") 
  116. cpp_quote("EXTERN_C const GUID DDPF_A8;") 
  117. cpp_quote("EXTERN_C const GUID DDPF_Z8;") 
  118. cpp_quote("EXTERN_C const GUID DDPF_Z16;") 
  119. cpp_quote("EXTERN_C const GUID DDPF_Z24;") 
  120. cpp_quote("EXTERN_C const GUID DDPF_Z32;") 
  121. cpp_quote("//")
  122. cpp_quote("//   Component categories")
  123. cpp_quote("//")
  124. cpp_quote("EXTERN_C const GUID CATID_DXImageTransform;")
  125. cpp_quote("EXTERN_C const GUID CATID_DX3DTransform;")
  126. cpp_quote("EXTERN_C const GUID CATID_DXAuthoringTransform;")
  127. cpp_quote("EXTERN_C const GUID CATID_DXSurface;")
  128. cpp_quote("//")
  129. cpp_quote("//   Service IDs")
  130. cpp_quote("//")
  131. cpp_quote("EXTERN_C const GUID SID_SDirectDraw;")
  132. cpp_quote("EXTERN_C const GUID SID_SDirect3DRM;")
  133. cpp_quote("#define SID_SDXTaskManager CLSID_DXTaskManager")
  134. cpp_quote("#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory")
  135. cpp_quote("#define SID_SDXTransformFactory IID_IDXTransformFactory")
  136. cpp_quote("//")
  137. cpp_quote("//   DXTransforms Core Type Library Version Info")
  138. cpp_quote("//")
  139. cpp_quote("#define DXTRANS_TLB_MAJOR_VER 1")
  140. cpp_quote("#define DXTRANS_TLB_MINOR_VER 1")
  141.  
  142. //=== Struct & Enum definitions =============================================
  143.  
  144. //=== Interface definitions =================================================
  145.  
  146.  
  147. //+-----------------------------------------------------------------------------
  148. //
  149. //  IDXBaseObject
  150. //
  151. //------------------------------------------------------------------------------
  152.  
  153.     [
  154.         object,
  155.         uuid(17B59B2B-9CC8-11d1-9053-00C04FD9189D),
  156.         helpstring("IDXBaseObject Interface"),
  157.         pointer_default(unique),
  158.         local
  159.     ]
  160.     interface IDXBaseObject : IUnknown
  161.     {
  162.         HRESULT GetGenerationId( [out]ULONG *pID);
  163.         HRESULT IncrementGenerationId([in] BOOL bRefresh);
  164.         HRESULT GetObjectSize( [out] ULONG *pcbSize);
  165.     };
  166.  
  167.  
  168. //+-----------------------------------------------------------------------------
  169. //
  170. //  Bounding rectangle and vector structures.
  171. //
  172. //------------------------------------------------------------------------------
  173.  
  174.     //--- Dimension identifiers
  175.     typedef enum DXBNDID
  176.     {
  177.         DXB_X = 0,
  178.         DXB_Y = 1,
  179.         DXB_Z = 2,
  180.         DXB_T = 3
  181.     } DXBNDID;
  182.  
  183.     //--- Bound types
  184.     typedef enum DXBNDTYPE
  185.     {
  186.         DXBT_DISCRETE,
  187.         DXBT_DISCRETE64,
  188.         DXBT_CONTINUOUS,
  189.         DXBT_CONTINUOUS64
  190.     } DXBNDTYPE;
  191.  
  192.     //--- Discrete bounds (image & sound)
  193.     typedef struct DXDBND
  194.     {
  195.         long  Min;    
  196.         long  Max;
  197.     } DXDBND;
  198.     typedef DXDBND DXDBNDS[4];
  199.  
  200.     typedef struct DXDBND64
  201.     {
  202.         LONGLONG Min;    
  203.         LONGLONG Max;
  204.     } DXDBND64;
  205.     typedef DXDBND64 DXDBNDS64[4];
  206.  
  207.     //--- Continuous bounds (geometry)
  208.     typedef struct DXCBND
  209.     {
  210.         float Min;    
  211.         float Max;
  212.     } DXCBND;
  213.     typedef DXCBND DXCBNDS[4];
  214.  
  215.     typedef struct DXCBND64
  216.     {
  217.         double Min;    
  218.         double Max;
  219.     } DXCBND64;
  220.     typedef DXCBND64 DXCBNDS64[4];
  221.  
  222.     //--- Combined space
  223.     typedef union DXBNDS switch( DXBNDTYPE eType ) u
  224.     {
  225.       case DXBT_DISCRETE:
  226.         DXDBND D[4];
  227.       case DXBT_DISCRETE64:
  228.         DXDBND64 LD[4];
  229.       case DXBT_CONTINUOUS:
  230.         DXCBND C[4];
  231.       case DXBT_CONTINUOUS64:
  232.         DXCBND64 LC[4];
  233.     } DXBNDS;
  234.  
  235.     //--- Discrete 4D vector
  236.     typedef long DXDVEC[4];
  237.     typedef LONGLONG DXDVEC64[4];
  238.  
  239.     //--- Continous 4D vector
  240.     typedef float DXCVEC[4];
  241.     typedef double DXCVEC64[4];
  242.  
  243.     //--- Combined space vector
  244.     typedef union DXVEC switch( DXBNDTYPE eType ) u
  245.     {
  246.       case DXBT_DISCRETE:
  247.         long D[4];
  248.       case DXBT_DISCRETE64:
  249.         LONGLONG LD[4];
  250.       case DXBT_CONTINUOUS:
  251.         float C[4];
  252.       case DXBT_CONTINUOUS64:
  253.         double LC[4];
  254.     } DXVEC;
  255.  
  256.  
  257. //+-----------------------------------------------------------------------------
  258. //
  259. //  IDXTransformFactory
  260. //
  261. //------------------------------------------------------------------------------
  262.  
  263.     [
  264.         object,
  265.         uuid(6A950B2B-A971-11d1-81C8-0000F87557DB),
  266.         helpstring("IDXTransformFactory Interface"),
  267.         pointer_default(unique),
  268.         local
  269.     ]
  270.     interface IDXTransformFactory : IServiceProvider
  271.     {
  272.         HRESULT SetService(  [in]REFGUID guidService, 
  273.                              [in]IUnknown *pUnkService,
  274.                              [in]BOOL bWeakReference);
  275.  
  276.         HRESULT CreateTransform( [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  277.                              [in]ULONG ulNumInputs,
  278.                              [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  279.                              [in]ULONG ulNumOutputs,
  280.                              [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog,
  281.                              [in]REFCLSID TransCLSID, [in]REFIID TransIID,
  282.                              [out, iid_is(TransIID)]void** ppTransform );
  283.  
  284.         HRESULT InitializeTransform( [in]IDXTransform* pTransform,
  285.                              [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  286.                              [in]ULONG ulNumInputs,
  287.                              [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  288.                              [in]ULONG ulNumOutputs,
  289.                              [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog );
  290.     };
  291.  
  292.  
  293. //+-----------------------------------------------------------------------------
  294. //
  295. //  IDXTransform
  296. //
  297. //------------------------------------------------------------------------------
  298.  
  299.     typedef enum DXTMISCFLAGS
  300.     {
  301.         DXTMF_BLEND_WITH_OUTPUT   = ( 1L << 0 ),
  302.         DXTMF_DITHER_OUTPUT       = ( 1L << 1 ),
  303.         DXTMF_OPTION_MASK         = (0x0000FFFF),   // Low word is settable options
  304.         DXTMF_VALID_OPTIONS       = (DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT),
  305.         //
  306.         //  Status flags can not be changed by call to SetMiscFlags
  307.         //
  308.         DXTMF_BLEND_SUPPORTED     = ( 1L << 16 ),
  309.         DXTMF_DITHER_SUPPORTED    = ( 1L << 17 ),
  310.         DXTMF_INPLACE_OPERATION   = ( 1L << 24 ),
  311.         DXTMF_BOUNDS_SUPPORTED    = ( 1L << 25 ),
  312.         DXTMF_PLACEMENT_SUPPORTED = ( 1L << 26 ),
  313.         DXTMF_QUALITY_SUPPORTED   = ( 1L << 27 ),
  314.         DXTMF_OPAQUE_RESULT       = ( 1L << 28 )
  315.     } DXTMISCFLAGS;
  316.  
  317.     typedef enum DXINOUTINFOFLAGS
  318.     {
  319.         DXINOUTF_OPTIONAL = ( 1L << 0)
  320.     } DXINOUTINFOFLAGS;
  321.  
  322.     [
  323.         object,
  324.         uuid(30A5FB78-E11F-11d1-9064-00C04FD9189D),
  325.         helpstring("IDXTransform Interface"),
  326.         pointer_default(unique),
  327.         local
  328.     ]
  329.     interface IDXTransform : IDXBaseObject
  330.     {
  331.         HRESULT Setup( [in, size_is(ulNumInputs)] IUnknown * const * punkInputs,
  332.                        [in]ULONG ulNumInputs,
  333.                        [in, size_is(ulNumOutputs)] IUnknown * const * punkOutputs,
  334.                        [in]ULONG ulNumOutputs,
  335.                        [in]DWORD dwFlags );
  336.  
  337.         HRESULT Execute( [in]const GUID* pRequestID, [in]const DXBNDS *pClipBnds,
  338.                         [in]const DXVEC *pPlacement );
  339.  
  340.         HRESULT MapBoundsIn2Out( [in] const DXBNDS *pInBounds,
  341.                         [in]ULONG ulNumInBnds,
  342.                         [in]ULONG ulOutIndex,
  343.                         [out]DXBNDS *pOutBounds );
  344.  
  345.         HRESULT MapBoundsOut2In( [in] ULONG ulOutIndex,
  346.                         [in] const DXBNDS *pOutBounds,
  347.                         [in] ULONG ulInIndex,
  348.                         [out]DXBNDS *pInBounds );
  349.  
  350.         HRESULT SetMiscFlags( [in] DWORD dwMiscFlags);
  351.         HRESULT GetMiscFlags( [out]DWORD * pdwMiscFlags );
  352.         HRESULT GetInOutInfo( [in]BOOL bIsOutput, [in]ULONG ulIndex,
  353.                         [out]DWORD *pdwFlags, [out, size_is(*pcIDs)] GUID *pIDs,
  354.                         [in, out] ULONG *pcIDs,
  355.                         [out] IUnknown **ppUnkCurrentObject);
  356.  
  357.         HRESULT SetQuality( [in] float fQuality );
  358.         HRESULT GetQuality( [out] float * fQuality );
  359.     };
  360.  
  361.  
  362. //+-----------------------------------------------------------------------------
  363. //
  364. //  IDXSurfacePick
  365. //
  366. //------------------------------------------------------------------------------
  367.  
  368.     [
  369.         object,
  370.         uuid(30A5FB79-E11F-11d1-9064-00C04FD9189D),
  371.         helpstring("IDXSurfacePick Interface"),
  372.         pointer_default(unique),
  373.         local
  374.     ]
  375.     interface IDXSurfacePick : IUnknown
  376.     {
  377.         HRESULT PointPick([in]const DXVEC *pPoint,
  378.                           [out]ULONG * pulInputSurfaceIndex,
  379.                           [out]DXVEC *pInputPoint);
  380.     };
  381.  
  382.  
  383. //+-----------------------------------------------------------------------------
  384. //
  385. //  IDXTBindHost
  386. //
  387. //  Overview:
  388. //      This interface is used to set a site-specific bind host for a transform.
  389. //      Only transforms that need access to a bind host need to implement this 
  390. //      interface.
  391. //
  392. //      For some reason, MIDL does not like IBindHost, so we've declared this
  393. //      interface local.
  394. //
  395. //------------------------------------------------------------------------------
  396.  
  397.     [
  398.         object,
  399.         uuid(D26BCE55-E9DC-11d1-9066-00C04FD9189D),
  400.         helpstring("IDXTBindHost Interface"),
  401.         pointer_default(unique),
  402.         local
  403.     ]
  404.     interface IDXTBindHost : IUnknown
  405.     {
  406.         HRESULT SetBindHost([in] IBindHost * pBindHost);
  407.     };
  408.  
  409.  
  410. //+-----------------------------------------------------------------------------
  411. //
  412. //  IDXTaskManager
  413. //
  414. //  Overview:
  415. //      This interface is used to implement a task managment service provider to
  416. //      optimize thread usage.
  417. //
  418. //------------------------------------------------------------------------------
  419.  
  420.     typedef void (__stdcall DXTASKPROC)(void *pTaskData, BOOL* pbContinueProcessing );
  421.     typedef DXTASKPROC *PFNDXTASKPROC;
  422.  
  423.     typedef void (__stdcall DXAPCPROC)(DWORD dwData);
  424.     typedef DXAPCPROC *PFNDXAPCPROC;
  425.  
  426. cpp_quote("#ifdef __cplusplus")
  427.  
  428.     cpp_quote("typedef struct DXTMTASKINFO" )
  429.     cpp_quote("{")
  430.     cpp_quote("    PFNDXTASKPROC pfnTaskProc;       // Pointer to function to execute")
  431.     cpp_quote("    PVOID         pTaskData;         // Pointer to argument data")
  432.     cpp_quote("    PFNDXAPCPROC  pfnCompletionAPC;  // Pointer to completion APC proc")
  433.     cpp_quote("    DWORD         dwCompletionData;  // Pointer to APC proc data")
  434.     cpp_quote("    const GUID*   pRequestID;        // Used to identify groups of tasks")
  435.     cpp_quote("} DXTMTASKINFO;")
  436.  
  437. cpp_quote("#else")
  438.  
  439.         typedef struct DXTMTASKINFO
  440.         {
  441.             PVOID       pfnTaskProc;       // Pointer to function to execute
  442.             PVOID       pTaskData;         // Pointer to argument data
  443.             PVOID       pfnCompletionAPC;  // Pointer to completion APC proc
  444.             DWORD       dwCompletionData;  // Pointer to APC proc data
  445.             const GUID* pRequestID;        // Used to identify groups of tasks
  446.         } DXTMTASKINFO;
  447.  
  448. cpp_quote("#endif")
  449.  
  450.     [
  451.         object,
  452.         uuid(254DBBC1-F922-11d0-883A-3C8B00C10000),
  453.         helpstring("IDXTaskManager Interface"),
  454.         pointer_default(unique),
  455.         local
  456.     ]
  457.     interface IDXTaskManager : IUnknown
  458.     {
  459.         HRESULT QueryNumProcessors( [out]ULONG* pulNumProc );
  460.         HRESULT SetThreadPoolSize( [in]ULONG ulNumThreads );
  461.         HRESULT GetThreadPoolSize( [out]ULONG* pulNumThreads );
  462.         HRESULT SetConcurrencyLimit( [in]ULONG ulNumThreads );
  463.         HRESULT GetConcurrencyLimit( [out]ULONG* pulNumThreads );
  464.         HRESULT ScheduleTasks( [in]DXTMTASKINFO TaskInfo[],
  465.                                [in]HANDLE Events[],
  466.                                [out]DWORD TaskIDs[],
  467.                                [in]ULONG ulNumTasks, [in]ULONG ulWaitPeriod );
  468.         HRESULT TerminateTasks( [in]DWORD TaskIDs[], [in]ULONG ulCount,
  469.                                 [in]ULONG ulTimeOut );
  470.         HRESULT TerminateRequest( [in]REFIID RequestID, [in]ULONG ulTimeOut );
  471.     };
  472.  
  473.  
  474. //+-----------------------------------------------------------------------------
  475. //
  476. //  Sample structures (C++)
  477. //
  478. //  Overview:
  479. //      We want an operator so that we can cast from a DXSAMPLE to a DWORD, so 
  480. //      for C++ we will define the structure a special way.
  481. //
  482. //------------------------------------------------------------------------------
  483.  
  484. cpp_quote("#ifdef __cplusplus")
  485.  
  486.     cpp_quote("/////////////////////////////////////////////////////")
  487.     cpp_quote("")
  488.     cpp_quote("class DXBASESAMPLE;")
  489.     cpp_quote("class DXSAMPLE;")
  490.     cpp_quote("class DXPMSAMPLE;")
  491.     cpp_quote("")
  492.     cpp_quote("/////////////////////////////////////////////////////")
  493.     cpp_quote("")
  494.     cpp_quote("class DXBASESAMPLE")
  495.     cpp_quote("{")
  496.     cpp_quote("public:")
  497.     cpp_quote("    BYTE Blue;")
  498.     cpp_quote("    BYTE Green;")
  499.     cpp_quote("    BYTE Red;")
  500.     cpp_quote("    BYTE Alpha;")
  501.     cpp_quote("    DXBASESAMPLE() {}")
  502.     cpp_quote("    DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  503.     cpp_quote("        Alpha(alpha),")
  504.     cpp_quote("        Red(red),")
  505.     cpp_quote("        Green(green),")
  506.     cpp_quote("        Blue(blue) {}")
  507.     cpp_quote("    DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }")
  508.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  509.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); }")
  510.     cpp_quote("}; // DXBASESAMPLE")
  511.     cpp_quote("")
  512.     cpp_quote("/////////////////////////////////////////////////////")
  513.     cpp_quote("")
  514.     cpp_quote("class DXSAMPLE : public DXBASESAMPLE")
  515.     cpp_quote("{")
  516.     cpp_quote("public:")
  517.     cpp_quote("    DXSAMPLE() {}")
  518.     cpp_quote("    DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  519.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  520.     cpp_quote("    DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); }")
  521.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  522.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); }")
  523.     cpp_quote("    operator DXPMSAMPLE() const;")
  524.     cpp_quote("}; // DXSAMPLE")
  525.     cpp_quote("")
  526.     cpp_quote("/////////////////////////////////////////////////////")
  527.     cpp_quote("")
  528.     cpp_quote("class DXPMSAMPLE : public DXBASESAMPLE")
  529.     cpp_quote("{")
  530.     cpp_quote("public:")
  531.     cpp_quote("    DXPMSAMPLE() {}")
  532.     cpp_quote("    DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  533.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  534.     cpp_quote("    DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); }")
  535.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  536.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); }")
  537.     cpp_quote("    operator DXSAMPLE() const;")
  538.     cpp_quote("}; // DXPMSAMPLE")
  539.     cpp_quote("")
  540.     cpp_quote("//")
  541.     cpp_quote("// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE")
  542.     cpp_quote("//")
  543.     cpp_quote("inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); }")
  544.     cpp_quote("inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); }")
  545.  
  546.  
  547. //+-----------------------------------------------------------------------------
  548. //
  549. //  Sample structures (IDL, C)
  550. //
  551. //------------------------------------------------------------------------------
  552.  
  553. cpp_quote("#else // !__cplusplus")
  554.  
  555.     typedef struct DXBASESAMPLE
  556.     {
  557.         BYTE Blue;
  558.         BYTE Green;
  559.         BYTE Red; 
  560.         BYTE Alpha;
  561.     } DXBASESAMPLE;
  562.  
  563.     typedef struct DXSAMPLE
  564.     {
  565.         BYTE Blue;
  566.         BYTE Green;
  567.         BYTE Red; 
  568.         BYTE Alpha;
  569.     } DXSAMPLE;
  570.  
  571.     typedef struct DXPMSAMPLE
  572.     {
  573.         BYTE Blue;
  574.         BYTE Green;
  575.         BYTE Red; 
  576.         BYTE Alpha;
  577.     } DXPMSAMPLE;
  578.  
  579. cpp_quote("#endif // !__cplusplus")
  580.  
  581. //+-----------------------------------------------------------------------------
  582. //
  583. //  DXRUNINFO structures.
  584. //
  585. //------------------------------------------------------------------------------
  586.  
  587.     typedef enum DXRUNTYPE
  588.     {
  589.         DXRUNTYPE_CLEAR  = 0,        // The run is zero Alpha
  590.         DXRUNTYPE_OPAQUE = 1,        // The run is full Alpha (i.e. 255)
  591.         DXRUNTYPE_TRANS  = 2,        // The run is non-zero Alpha
  592.         DXRUNTYPE_UNKNOWN= 3         // The run type is unknown.  Caller must inspect.
  593.     } DXRUNTYPE;
  594.  
  595.     const ULONG DX_MAX_RUN_INFO_COUNT = 128; // Defines the maximum number of RUNINFOs in a single row
  596.  
  597.  
  598.     cpp_quote("// Ignore the definition used by MIDL for TLB generation")
  599.     cpp_quote("#if 0")
  600.  
  601.     typedef struct DXRUNINFO
  602.     {
  603.         ULONG Bitfields;
  604.     } DXRUNINFO;
  605.  
  606.     cpp_quote("#endif // 0")
  607.  
  608.     // Emit the C definition to the H file directly, as bit fields are not
  609.     // supported by MIDL.
  610.  
  611.     cpp_quote("typedef struct DXRUNINFO")
  612.     cpp_quote("{")
  613.     cpp_quote("    ULONG   Type  : 2;   // Type")
  614.     cpp_quote("    ULONG   Count : 30;  // Number of samples in run")
  615.     cpp_quote("} DXRUNINFO;")
  616.  
  617.  
  618.     typedef enum DXSFCREATE
  619.     {
  620.         DXSF_FORMAT_IS_CLSID    = ( 1L << 0 ),
  621.         DXSF_NO_LAZY_DDRAW_LOCK = ( 1L << 1 )
  622.     } DXSFCREATE;
  623.  
  624.     typedef enum DXBLTOPTIONS
  625.     {
  626.         DXBOF_DO_OVER          = (1L << 0),
  627.         DXBOF_DITHER           = (1L << 1)
  628.     } DXBLTOPTIONS;
  629.  
  630.  
  631. //+-----------------------------------------------------------------------------
  632. //
  633. //  IDXSurfaceModifier
  634. //
  635. //------------------------------------------------------------------------------
  636.  
  637.     [
  638.         object,
  639.         uuid(144946F5-C4D4-11d1-81D1-0000F87557DB),
  640.         helpstring("IDXSurfaceFactory Interface"),
  641.         pointer_default(unique),
  642.         local
  643.     ]
  644.     interface IDXSurfaceFactory : IUnknown
  645.     {
  646.         HRESULT CreateSurface([in] IUnknown *pDirectDraw,
  647.                               [in] const DDSURFACEDESC * pDDSurfaceDesc,
  648.                               [in] const GUID * pFormatID,
  649.                               [in] const DXBNDS *pBounds, 
  650.                               [in] DWORD dwFlags,
  651.                               [in] IUnknown *punkOuter,
  652.                               [in] REFIID riid, 
  653.                               [out, iid_is( riid )] void ** ppDXSurface);
  654.  
  655.         HRESULT CreateFromDDSurface([in] IUnknown *pDDrawSurface,
  656.                               [in] const GUID *pFormatID,
  657.                               [in] DWORD dwFlags,
  658.                               [in] IUnknown *punkOuter,
  659.                               [in] REFIID riid, 
  660.                               [out, iid_is( riid )] void ** ppDXSurface);
  661.  
  662.         HRESULT LoadImage(
  663.                           [in] const LPWSTR pszFileName,
  664.                           [in] IUnknown *pDirectDraw,
  665.                           [in] const DDSURFACEDESC * pDDSurfaceDesc,
  666.                           [in] const GUID *pFormatID,
  667.                           [in] REFIID riid, 
  668.                           [out, iid_is( riid )] void ** ppDXSurface);
  669.  
  670.         HRESULT LoadImageFromStream([in] IStream *pStream,
  671.                                     [in] IUnknown *pDirectDraw,
  672.                                     [in] const DDSURFACEDESC * pDDSurfaceDesc,
  673.                                     [in] const GUID *pFormatID,
  674.                                     [in] REFIID riid, 
  675.                                     [out, iid_is( riid )] void ** ppDXSurface);
  676.  
  677.         HRESULT CopySurfaceToNewFormat( [in]IDXSurface* pSrc,
  678.                                         [in] IUnknown *pDirectDraw,
  679.                                         [in] const DDSURFACEDESC * pDDSurfaceDesc,
  680.                                         [in] const GUID *pDestFormatID,
  681.                                         [out] IDXSurface** ppNewSurface );
  682.  
  683.         HRESULT CreateD3DRMTexture([in] IDXSurface *pSrc,
  684.                                    [in] IUnknown *pDirectDraw,
  685.                                    [in] IUnknown *pD3DRM3,
  686.                                    [in] REFIID riid,
  687.                                    [out, iid_is(riid)] void **ppTexture3);
  688.  
  689.         HRESULT BitBlt([in] IDXSurface *pDest,
  690.                        [in] const DXVEC *pPlacement,
  691.                        [in] IDXSurface *pSrc,
  692.                        [in] const DXBNDS *pClipBounds,
  693.                        [in] DWORD dwFlags);
  694.     };
  695.  
  696.  
  697. //+-----------------------------------------------------------------------------
  698. //
  699. //  IDXSurfaceModifier
  700. //
  701. //------------------------------------------------------------------------------
  702.  
  703.     typedef enum DXSURFMODCOMPOP
  704.     {
  705.         DXSURFMOD_COMP_OVER         = 0,
  706.         DXSURFMOD_COMP_ALPHA_MASK   = 1,
  707.         DXSURFMOD_COMP_MAX_VALID    = 1
  708.     } DXSURFMODCOMPOP;
  709.     
  710.     [
  711.         object,
  712.         uuid(9EA3B637-C37D-11d1-905E-00C04FD9189D),
  713.         helpstring("IDXSurfaceModifier Interface"),
  714.         pointer_default(unique),
  715.         local
  716.     ]
  717.     interface IDXSurfaceModifier : IUnknown
  718.     {
  719.         HRESULT SetFillColor([in] DXSAMPLE Color);
  720.         HRESULT GetFillColor([out] DXSAMPLE *pColor);
  721.         HRESULT SetBounds([in] const DXBNDS *pBounds ); // Get supported though IDXSurface interface
  722.         HRESULT SetBackground([in] IDXSurface *pSurface);
  723.         HRESULT GetBackground([out] IDXSurface **ppSurface);
  724.         HRESULT SetCompositeOperation([in] DXSURFMODCOMPOP CompOp);
  725.         HRESULT GetCompositeOperation([out] DXSURFMODCOMPOP *pCompOp);
  726.         //
  727.         //  The following methods only apply to the FOREGROUND surface
  728.         //
  729.         HRESULT SetForeground([in] IDXSurface *pSurface, [in] BOOL bTile, [in] const POINT * pOrigin);
  730.         HRESULT GetForeground([out] IDXSurface **ppSurface, [out] BOOL *pbTile, [out] POINT * pOrigin);
  731.         HRESULT SetOpacity([in] float Opacity);
  732.         HRESULT GetOpacity([out] float *pOpacity);    
  733.         HRESULT SetLookup( [in]IDXLookupTable * pLookupTable );
  734.         HRESULT GetLookup( [out]IDXLookupTable ** ppLookupTable );
  735.     };
  736.  
  737.  
  738. //+-----------------------------------------------------------------------------
  739. //
  740. //  IDXSurface
  741. //
  742. //------------------------------------------------------------------------------
  743.  
  744.     typedef enum DXSAMPLEFORMATENUM
  745.     {
  746.         DXPF_FLAGSMASK      = (0xFFFF0000), // Top word is flags, low word is enum  
  747.         DXPF_NONPREMULT     = (0x00010000), // Flags to be OR'd with pixel formats
  748.         DXPF_TRANSPARENCY   = (0x00020000), // Color key or one-bit alpha (alpha only 0 or 0xFF)
  749.         DXPF_TRANSLUCENCY   = (0x00040000), // Alpha can be any value from 0->0xFF
  750.         //
  751.         //  This 3-bit field is used to determine what type of dithering to be used
  752.         //  
  753.         DXPF_2BITERROR      = (0x00200000), // 2 bits of error term 
  754.         DXPF_3BITERROR      = (0x00300000), // 3 bits of error term for color (16-bit color)
  755.         DXPF_4BITERROR      = (0x00400000), // 4 bits of error term (ARGB 4444)
  756.         DXPF_5BITERROR      = (0x00500000), // 5 bits of error term for color (8-bit color)
  757.         DXPF_ERRORMASK      = (0x00700000), // Mask of bits used for dithering
  758.  
  759.         DXPF_NONSTANDARD    = (0),  // To be used for any surface that is not one of the following formats
  760.                                     // This can be combined with DXPFNONPREMULT if the surface can work
  761.                                     // better in non-premultiplied space.
  762.         DXPF_PMARGB32       = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  763.         DXPF_ARGB32         = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  764.         DXPF_ARGB4444       = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR),
  765.         DXPF_A8             = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  766.         DXPF_RGB32          = (5),
  767.         DXPF_RGB24          = (6),
  768.         DXPF_RGB565         = (7 | DXPF_3BITERROR),
  769.         DXPF_RGB555         = (8 | DXPF_3BITERROR),
  770.         DXPF_RGB8           = (9 | DXPF_5BITERROR),
  771.         DXPF_ARGB1555       = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR),
  772.         DXPF_RGB32_CK       = (DXPF_RGB32 | DXPF_TRANSPARENCY),
  773.         DXPF_RGB24_CK       = (DXPF_RGB24 | DXPF_TRANSPARENCY),
  774.         DXPF_RGB555_CK      = (DXPF_RGB555 | DXPF_TRANSPARENCY),
  775.         DXPF_RGB565_CK      = (DXPF_RGB565 | DXPF_TRANSPARENCY),
  776.         DXPF_RGB8_CK        = (DXPF_RGB8 | DXPF_TRANSPARENCY)
  777.     } DXSAMPLEFORMATENUM;
  778.  
  779.     typedef enum DXLOCKSURF
  780.     {
  781.         DXLOCKF_READ        =       0,
  782.         DXLOCKF_READWRITE   =       (1 << 0),
  783.         DXLOCKF_EXISTINGINFOONLY =  (1 << 1),   // If used in conjunction with WANTRUNINFO will prevent creation of a runmap if one does not exist
  784.         DXLOCKF_WANTRUNINFO =       (1 << 2),
  785.         //
  786.         // The flags in the high word should be specific to the type of pointer that
  787.         // is requested.  These flags define ARGB flags.  These flags are advisory and
  788.         // are not required to be set for ARGB locks.
  789.         //
  790.         DXLOCKF_NONPREMULT  =   (1 << 16),    // Caller will request non-premultiplied data
  791.         DXLOCKF_VALIDFLAGS  =   (DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT)
  792.     } DXLOCKSURF;
  793.  
  794.     typedef enum DXSURFSTATUS
  795.     {
  796.         DXSURF_TRANSIENT    =   (1 << 0),   // Data in this surface changes often.    
  797.         DXSURF_READONLY     =   (1 << 1),   // Surface is read-only
  798.         DXSURF_VALIDFLAGS   =   (DXSURF_TRANSIENT | DXSURF_READONLY)    
  799.     } DXSURFSTATUS;
  800.  
  801.     [
  802.         object,
  803.         uuid(B39FD73F-E139-11d1-9065-00C04FD9189D),
  804.         helpstring("IDXSurface Interface"),
  805.         pointer_default(unique),
  806.         local
  807.     ]
  808.     interface IDXSurface : IDXBaseObject
  809.     {
  810.         HRESULT GetPixelFormat([out] GUID * pFormatID, [out] DXSAMPLEFORMATENUM *pSampleFormatEnum); 
  811.         HRESULT GetBounds( [out]DXBNDS *pBounds );
  812.         HRESULT GetStatusFlags([out] DWORD * pdwStatusFlags);
  813.         HRESULT SetStatusFlags([in] DWORD dwStatusFlags);
  814.         HRESULT LockSurface( [in]const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in]DWORD dwFlags, 
  815.                              [in]REFIID riid, [out, iid_is(riid)] void **ppPointer,
  816.                              [out]ULONG* pulGenerationId );
  817.         HRESULT GetDirectDrawSurface( [in] REFIID riid,
  818.                                       [out, iid_is(riid)] void ** ppSurface);
  819.         HRESULT GetColorKey(DXSAMPLE * pColorKey);  // Can return E_NOTIMPL
  820.         HRESULT SetColorKey(DXSAMPLE ColorKey);     // Set color of 0 to get rid of color key, can return E_NOTIMPL
  821.         HRESULT LockSurfaceDC( [in] const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in] DWORD dwFlags,
  822.                                [out] IDXDCLock **ppDCLock);
  823.         HRESULT SetAppData(DWORD_PTR dwAppData);
  824.         HRESULT GetAppData(DWORD_PTR *pdwAppData);
  825.     };
  826.  
  827.  
  828. //+-----------------------------------------------------------------------------
  829. //
  830. //  IDXSurfaceInit
  831. //
  832. //------------------------------------------------------------------------------
  833.  
  834.     [
  835.         object,
  836.         uuid(9EA3B639-C37D-11d1-905E-00C04FD9189D),
  837.         helpstring("IDXSurfaceInit Interface"),
  838.         pointer_default(unique),
  839.         local
  840.     ]
  841.     interface IDXSurfaceInit : IUnknown
  842.     {
  843.         HRESULT InitSurface([in] IUnknown *pDirectDraw,
  844.                             [in] const DDSURFACEDESC *pDDSurfaceDesc,
  845.                             [in] const GUID * pFormatID,
  846.                             [in] const DXBNDS *pBounds,
  847.                             [in] DWORD dwFlags);
  848.     };
  849.  
  850.  
  851. //+-----------------------------------------------------------------------------
  852. //
  853. //  IDXARGBSurfaceInit
  854. //
  855. //------------------------------------------------------------------------------
  856.  
  857.     [
  858.         object,
  859.         uuid(9EA3B63A-C37D-11d1-905E-00C04FD9189D),
  860.         helpstring("IDXARGBSurfaceInit Interface"),
  861.         pointer_default(unique),
  862.         local
  863.     ]
  864.     interface IDXARGBSurfaceInit : IDXSurfaceInit
  865.     {
  866.         HRESULT InitFromDDSurface( [in] IUnknown *pDDrawSurface,
  867.                                    [in] const GUID * pFormatID,
  868.                                    [in] DWORD dwFlags);
  869.         HRESULT InitFromRawSurface([in] IDXRawSurface *pRawSurface);
  870.     };
  871.  
  872.  
  873. //+-----------------------------------------------------------------------------
  874. //
  875. //  IDXARGBReadPtr
  876. //
  877. //------------------------------------------------------------------------------
  878.  
  879.     typedef struct tagDXNATIVETYPEINFO
  880.     {
  881.         BYTE *          pCurrentData;
  882.         BYTE *          pFirstByte;
  883.         long            lPitch;
  884.         DWORD           dwColorKey;
  885.     } DXNATIVETYPEINFO;
  886.  
  887.     typedef struct tagDXPACKEDRECTDESC
  888.     {
  889.         DXBASESAMPLE    *pSamples;
  890.         BOOL            bPremult;
  891.         RECT            rect;
  892.         long            lRowPadding;
  893.     } DXPACKEDRECTDESC;
  894.  
  895.     typedef struct tagDXOVERSAMPLEDESC
  896.     {
  897.         POINT       p;
  898.         DXPMSAMPLE  Color;
  899.     } DXOVERSAMPLEDESC;
  900.         
  901.     [
  902.         object,
  903.         uuid(EAAAC2D6-C290-11d1-905D-00C04FD9189D),
  904.         helpstring("IDXARGBReadPtr Interface"),
  905.         pointer_default(unique),
  906.         local
  907.     ]
  908.     interface IDXARGBReadPtr : IUnknown
  909.     {
  910.         HRESULT GetSurface( [in]REFIID riid, [out, iid_is( riid )]void ** ppSurface);
  911.         DXSAMPLEFORMATENUM GetNativeType( [out]DXNATIVETYPEINFO *pInfo );
  912.         void Move( [in]long cSamples );
  913.         void MoveToRow( [in]ULONG y );
  914.         void MoveToXY( [in]ULONG x, [in]ULONG y);
  915.         ULONG MoveAndGetRunInfo( [in]ULONG Row, [out] const DXRUNINFO** ppInfo );  // Returns count of runs
  916.         DXSAMPLE   * Unpack( [in]DXSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  917.         DXPMSAMPLE * UnpackPremult( [in]DXPMSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  918.         void UnpackRect([in] const DXPACKEDRECTDESC * pRectDesc);
  919.     };
  920.  
  921.  
  922. //+-----------------------------------------------------------------------------
  923. //
  924. //  IDXARGBReadWritePtr
  925. //
  926. //------------------------------------------------------------------------------
  927.  
  928.     [
  929.         object,
  930.         uuid(EAAAC2D7-C290-11d1-905D-00C04FD9189D),
  931.         helpstring("IDXARGBReadWritePtr Interface"),
  932.         pointer_default(unique),
  933.         local
  934.     ]
  935.     interface IDXARGBReadWritePtr : IDXARGBReadPtr
  936.     {
  937.         void PackAndMove( [in]const DXSAMPLE *pSamples, [in]ULONG cSamples );
  938.         void PackPremultAndMove( [in]const DXPMSAMPLE *pSamples, [in]ULONG cSamples );
  939.         void PackRect([in]const DXPACKEDRECTDESC *pRectDesc);
  940.         void CopyAndMoveBoth( [in]DXBASESAMPLE *pScratchBuffer, [in]IDXARGBReadPtr *pSrc,
  941.                               [in]ULONG cSamples, [in]BOOL bIsOpaque );
  942.         void CopyRect( [in] DXBASESAMPLE *pScratchBuffer, 
  943.                        [in] const RECT *pDestRect, [in]IDXARGBReadPtr *pSrc,
  944.                        [in] const POINT *pSrcOrigin, [in]BOOL bIsOpaque);
  945.         void FillAndMove( [in]DXBASESAMPLE *pScratchBuffer, [in]DXPMSAMPLE SampVal,
  946.                           [in]ULONG cSamples, [in]BOOL bDoOver );
  947.         void FillRect( [in]const RECT *pRect, [in]DXPMSAMPLE SampVal, [in]BOOL bDoOver );
  948.         void OverSample( [in]const DXOVERSAMPLEDESC * pOverDesc);
  949.         void OverArrayAndMove([in]DXBASESAMPLE *pScratchBuffer, 
  950.                               [in] const DXPMSAMPLE *pSrc,
  951.                               [in] ULONG cSamples);
  952.     };
  953.  
  954.  
  955. //+-----------------------------------------------------------------------------
  956. //
  957. //  IDXDCLock
  958. //
  959. //------------------------------------------------------------------------------
  960.  
  961.     [
  962.         object,
  963.         uuid(0F619456-CF39-11d1-905E-00C04FD9189D),
  964.         helpstring("IDXDCLock Interface"),
  965.         pointer_default(unique),
  966.         local
  967.     ]
  968.     interface IDXDCLock : IUnknown
  969.     {
  970.         HDC GetDC(void);
  971.     };
  972.  
  973.  
  974. //+-----------------------------------------------------------------------------
  975. //
  976. //  IDXTScaleOutput
  977. //
  978. //  Overview:
  979. //      Generic interface that any transform can support which allows caller to
  980. //      specify the desired output bounds.
  981. //------------------------------------------------------------------------------
  982.  
  983.     [
  984.         object,
  985.         uuid(B2024B50-EE77-11d1-9066-00C04FD9189D),
  986.         helpstring("IDXTScaleOutput Interface"),
  987.         pointer_default(unique),
  988.         local
  989.     ]
  990.     interface IDXTScaleOutput : IUnknown
  991.     {
  992.         HRESULT SetOutputSize([in] const SIZE OutSize, [in] BOOL bMaintainAspect);
  993.     };
  994.  
  995.  
  996. //+-----------------------------------------------------------------------------
  997. //
  998. //  IDXGradient
  999. //
  1000. //------------------------------------------------------------------------------
  1001.  
  1002.     [
  1003.         object,
  1004.         uuid(B2024B51-EE77-11d1-9066-00C04FD9189D),
  1005.         helpstring("IDXGradient Interface"),
  1006.         pointer_default(unique),
  1007.         local
  1008.     ]
  1009.     interface IDXGradient : IDXTScaleOutput
  1010.     {
  1011.         HRESULT SetGradient(DXSAMPLE StartColor, DXSAMPLE EndColor, BOOL bHorizontal);
  1012.         HRESULT GetOutputSize([out] SIZE *pOutSize);
  1013.     };
  1014.  
  1015.  
  1016. //+-----------------------------------------------------------------------------
  1017. //
  1018. //  IDXTScale
  1019. //
  1020. //  Overview:
  1021. //      This is the control interface for the simple scale transform.
  1022. //
  1023. //------------------------------------------------------------------------------
  1024.  
  1025.     [
  1026.         object,
  1027.         uuid(B39FD742-E139-11d1-9065-00C04FD9189D),
  1028.         helpstring("IDXTScale Interface"),
  1029.         pointer_default(unique),
  1030.         local
  1031.     ]
  1032.     interface IDXTScale : IUnknown
  1033.     {
  1034.         HRESULT SetScales( [in]float Scales[2] );
  1035.         HRESULT GetScales( [out]float Scales[2] );
  1036.         HRESULT ScaleFitToSize( [in,out]DXBNDS* pClipBounds,
  1037.                                 [in]SIZE FitToSize, [in]BOOL bMaintainAspect );
  1038.     };
  1039.  
  1040.  
  1041. //+-----------------------------------------------------------------------------
  1042. //
  1043. //  IDXEffect
  1044. //  
  1045. //  Overview:
  1046. //      This interface is used to generically control transforms that are
  1047. //      transition effects.
  1048. //
  1049. //------------------------------------------------------------------------------
  1050.  
  1051.     typedef enum DISPIDDXEFFECT
  1052.     {
  1053.         DISPID_DXECAPABILITIES = 10000, // Start at 10000 to avoid conflicts with inhereted interfaces
  1054.         DISPID_DXEPROGRESS,
  1055.         DISPID_DXESTEP,
  1056.         DISPID_DXEDURATION,
  1057.         DISPID_DXE_NEXT_ID
  1058.     } DISPIDDXBOUNDEDEFFECT;
  1059.  
  1060.     typedef enum DXEFFECTTYPE
  1061.     {
  1062.         DXTET_PERIODIC = (1 << 0),  // Result at 1 is same as result at 0
  1063.         DXTET_MORPH = (1 << 1)      // Transition between 2 inputs (input 0 to input 1)
  1064.     } DXEFFECTTYPE;
  1065.  
  1066.     [
  1067.         object,
  1068.         uuid(E31FB81B-1335-11d1-8189-0000F87557DB),
  1069.         helpstring("IDXEffect Interface"),
  1070.         pointer_default(unique),
  1071.         dual
  1072.     ]
  1073.     interface IDXEffect : IDispatch
  1074.     {
  1075.         [propget, id(DISPID_DXECAPABILITIES)]
  1076.             HRESULT Capabilities([out, retval] long *pVal);
  1077.         [propget, id(DISPID_DXEPROGRESS)]
  1078.             HRESULT Progress([out, retval] float *pVal);
  1079.         [propput, id(DISPID_DXEPROGRESS)]
  1080.             HRESULT Progress([in] float newVal);
  1081.         [propget, id(DISPID_DXESTEP)]
  1082.             HRESULT StepResolution([out, retval] float *pVal);
  1083.         [propget, id(DISPID_DXEDURATION)]
  1084.             HRESULT Duration([out, retval] float *pVal);
  1085.         [propput, id(DISPID_DXEDURATION)]
  1086.             HRESULT Duration([in] float newVal);
  1087.     };
  1088.  
  1089.  
  1090. //+-----------------------------------------------------------------------------
  1091. //
  1092. //  IDXLookupTable
  1093. //
  1094. //------------------------------------------------------------------------------
  1095.  
  1096.     [
  1097.         object,
  1098.         uuid(01BAFC7F-9E63-11d1-9053-00C04FD9189D),
  1099.         helpstring("IDXLookupTable Interface"),
  1100.         pointer_default(unique),
  1101.         local
  1102.     ]
  1103.     interface IDXLookupTable : IDXBaseObject
  1104.     {
  1105.         HRESULT GetTables( [out]BYTE RedLUT[256],
  1106.                            [out]BYTE GreenLUT[256],
  1107.                            [out]BYTE BlueLUT[256],
  1108.                            [out]BYTE AlphaLUT[256] );
  1109.  
  1110.         HRESULT IsChannelIdentity([out] DXBASESAMPLE * pSampleBools);
  1111.         HRESULT GetIndexValues([in] ULONG Index, [out] DXBASESAMPLE *pSample);
  1112.         HRESULT ApplyTables([in, out] DXSAMPLE *pSamples, [in] ULONG cSamples);
  1113.     };
  1114.  
  1115.  
  1116. //+-----------------------------------------------------------------------------
  1117. //
  1118. //  IDXRawSurface
  1119. //
  1120. //  Overview:
  1121. //      User created objects support IDXRawSurface
  1122. //
  1123. //------------------------------------------------------------------------------
  1124.  
  1125.     typedef struct DXRAWSURFACEINFO
  1126.     {
  1127.         BYTE *          pFirstByte;
  1128.         long            lPitch;
  1129.         ULONG           Width;
  1130.         ULONG           Height;
  1131.         const GUID *    pPixelFormat;
  1132.         HDC             hdc;
  1133.         DWORD           dwColorKey;     // Note:  High byte must == 0xFF for color keyed surface.  Low 3 bytes are native data type.
  1134.         DXBASESAMPLE *  pPalette;
  1135.     } DXRAWSURFACEINFO;
  1136.  
  1137.     [
  1138.         object,
  1139.         uuid(09756C8A-D96A-11d1-9062-00C04FD9189D),
  1140.         helpstring("IDXRawSurface Interface"),
  1141.         pointer_default(unique),
  1142.         local
  1143.     ]
  1144.     interface IDXRawSurface : IUnknown
  1145.     {
  1146.         HRESULT GetSurfaceInfo(DXRAWSURFACEINFO * pSurfaceInfo);
  1147.     };
  1148.  
  1149.  
  1150. //+-----------------------------------------------------------------------------
  1151. //
  1152. //  IHTMLDXTransform
  1153. //
  1154. //------------------------------------------------------------------------------
  1155.  
  1156.     [
  1157.         object,
  1158.         uuid(30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5),
  1159.         helpstring("IHTMLDXTransform Interface"),
  1160.         pointer_default(unique),
  1161.         local
  1162.     ]
  1163.     interface IHTMLDXTransform : IUnknown
  1164.     {
  1165.         HRESULT SetHostUrl(BSTR bstrHostUrl);
  1166.     };
  1167.  
  1168.  
  1169. //+-----------------------------------------------------------------------------
  1170. //
  1171. //  ICSSFilterDispatch
  1172. //
  1173. //------------------------------------------------------------------------------
  1174.  
  1175.     typedef enum DXTFILTER_STATUS
  1176.     {
  1177.         DXTFILTER_STATUS_Stopped   = 0,
  1178.         DXTFILTER_STATUS_Applied,
  1179.         DXTFILTER_STATUS_Playing,
  1180.         DXTFILTER_STATUS_MAX
  1181.     } DXTFILTER_STATUS;
  1182.  
  1183.     typedef enum DXTFILTER_DISPID
  1184.     {
  1185.         DISPID_DXTFilter_Percent = 1,
  1186.         DISPID_DXTFilter_Duration,
  1187.         DISPID_DXTFilter_Enabled,
  1188.         DISPID_DXTFilter_Status,
  1189.         DISPID_DXTFilter_Apply,
  1190.         DISPID_DXTFilter_Play,
  1191.         DISPID_DXTFilter_Stop,
  1192.         DISPID_DXTFilter_MAX
  1193.     } DXTFILTER_DISPID;
  1194.  
  1195.     [
  1196.         object,
  1197.         uuid(9519152B-9484-4A6C-B6A7-4F25E92D6C6B),
  1198.         helpstring("ICSSFilterDispatch Interface"),
  1199.         pointer_default(unique),
  1200.         dual
  1201.     ]
  1202.     interface ICSSFilterDispatch : IDispatch
  1203.     {
  1204.         [propget, id(DISPID_DXTFilter_Percent)]  HRESULT Percent( [out, retval] float *pVal);
  1205.         [propput, id(DISPID_DXTFilter_Percent)]  HRESULT Percent( [in]          float newVal);
  1206.         [propget, id(DISPID_DXTFilter_Duration)] HRESULT Duration([out, retval] float *pVal);
  1207.         [propput, id(DISPID_DXTFilter_Duration)] HRESULT Duration([in]          float newVal);
  1208.         [propget, id(DISPID_DXTFilter_Enabled)]  HRESULT Enabled( [out, retval] VARIANT_BOOL *pfVal);
  1209.         [propput, id(DISPID_DXTFilter_Enabled)]  HRESULT Enabled( [in]          VARIANT_BOOL fVal);
  1210.         [propget, id(DISPID_DXTFilter_Status)]   HRESULT Status(  [out, retval] DXTFILTER_STATUS * peVal);
  1211.         [id(DISPID_DXTFilter_Apply)] HRESULT Apply();
  1212.         [id(DISPID_DXTFilter_Play)]  HRESULT Play([in, optional] VARIANT varDuration);
  1213.         [id(DISPID_DXTFilter_Stop)]  HRESULT Stop();
  1214.     };
  1215.  
  1216.  
  1217. //=== CoClass definitions =================================================
  1218.  
  1219. [
  1220.     uuid(54314D1D-35FE-11d1-81A1-0000F87557DB),
  1221.     version(1.1),
  1222.     helpstring("Microsoft DirectX Transforms Core Type Library")
  1223. ]
  1224. library DXTRANSLib
  1225. {
  1226.     importlib("stdole2.tlb");
  1227.  
  1228.     ///////////////////////////////
  1229.     // DXTransformFactory CoClass
  1230.     ///////////////////////////////
  1231.     [
  1232.         uuid(D1FE6762-FC48-11D0-883A-3C8B00C10000),
  1233.         helpstring("DXTransformFactory Class")
  1234.     ]
  1235.     coclass DXTransformFactory
  1236.     {
  1237.         [default] interface IDXTransformFactory;
  1238.         interface IDXSurfaceFactory;
  1239.     };
  1240.  
  1241.  
  1242.     ///////////////////////////////
  1243.     // DXTaskManager CoClass
  1244.     ///////////////////////////////
  1245.     [
  1246.         uuid(4CB26C03-FF93-11d0-817E-0000F87557DB),
  1247.         helpstring("DXTaskManager Class")
  1248.     ]
  1249.     coclass DXTaskManager
  1250.     {
  1251.         [default] interface IDXTaskManager;
  1252.     };
  1253.  
  1254.  
  1255.     ///////////////////////////////
  1256.     // DXTScale CoClass
  1257.     ///////////////////////////////
  1258.     [
  1259.         uuid(555278E2-05DB-11D1-883A-3C8B00C10000),
  1260.         helpstring("DXTScale Class")
  1261.     ]
  1262.     coclass DXTScale
  1263.     {
  1264.         [default] interface IDXTScale;
  1265.     };
  1266.  
  1267.  
  1268.     ///////////////////////////////
  1269.     // DXSurface CoClass
  1270.     ///////////////////////////////
  1271.     [
  1272.     uuid(0E890F83-5F79-11D1-9043-00C04FD9189D),
  1273.     helpstring("DXSurface Class")
  1274.     ]
  1275.     coclass DXSurface
  1276.     {
  1277.     [default] interface IDXSurface;
  1278.     };
  1279.  
  1280.  
  1281.     ///////////////////////////////
  1282.     // DXSurfaceModifier CoClass
  1283.     ///////////////////////////////
  1284.     [
  1285.     uuid(3E669F1D-9C23-11d1-9053-00C04FD9189D),
  1286.     helpstring("DXSurfaceModifier Class")
  1287.     ]
  1288.     coclass DXSurfaceModifier
  1289.     {
  1290.     [default] interface IDXSurfaceModifier;
  1291.     };
  1292.  
  1293.  
  1294.     ///////////////////////////////
  1295.     // DXGradient CoClass
  1296.     ///////////////////////////////
  1297.     [
  1298.     uuid(C6365470-F667-11d1-9067-00C04FD9189D),
  1299.     helpstring("DXGradient Class")
  1300.     ]
  1301.     coclass DXGradient
  1302.     {
  1303.         [default] interface IDXGradient;
  1304.     };
  1305.  
  1306.  
  1307.     ///////////////////////////////
  1308.     // DXTFilter CoClass
  1309.     ///////////////////////////////
  1310.     [
  1311.         uuid(385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD),
  1312.         helpstring("DXTFilter Class")
  1313.     ]
  1314.     coclass DXTFilter
  1315.     {
  1316.         [default] interface ICSSFilterDispatch;
  1317.     };
  1318. };
  1319.  
  1320.  
  1321. /////////////////////////////////////////////////////////////////////////////
  1322. //
  1323. //  Windows XP vs. DirectX 8.0 header merge
  1324. //
  1325. //  The following is the original contents of this header from
  1326. //  the DirectX 8.0 SDK.
  1327. //
  1328. /////////////////////////////////////////////////////////////////////////////
  1329.  
  1330. #else     // DirectX 8.0 content
  1331.  
  1332.  
  1333.     //=== Constants =============================================================
  1334.  
  1335.     cpp_quote("//")
  1336.     cpp_quote("//   All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory")
  1337.     cpp_quote("//")
  1338.     cpp_quote("EXTERN_C const GUID DDPF_RGB1;") 
  1339.     cpp_quote("EXTERN_C const GUID DDPF_RGB2;") 
  1340.     cpp_quote("EXTERN_C const GUID DDPF_RGB4;") 
  1341.     cpp_quote("EXTERN_C const GUID DDPF_RGB8;") 
  1342.     cpp_quote("EXTERN_C const GUID DDPF_RGB332;") 
  1343.     cpp_quote("EXTERN_C const GUID DDPF_ARGB4444;") 
  1344.     cpp_quote("EXTERN_C const GUID DDPF_RGB565;") 
  1345.     cpp_quote("EXTERN_C const GUID DDPF_BGR565;") 
  1346.     cpp_quote("EXTERN_C const GUID DDPF_RGB555;") 
  1347.     cpp_quote("EXTERN_C const GUID DDPF_ARGB1555;") 
  1348.     cpp_quote("EXTERN_C const GUID DDPF_RGB24;") 
  1349.     cpp_quote("EXTERN_C const GUID DDPF_BGR24;") 
  1350.     cpp_quote("EXTERN_C const GUID DDPF_RGB32;") 
  1351.     cpp_quote("EXTERN_C const GUID DDPF_BGR32;") 
  1352.     cpp_quote("EXTERN_C const GUID DDPF_ABGR32;") 
  1353.     cpp_quote("EXTERN_C const GUID DDPF_ARGB32;") 
  1354.     cpp_quote("EXTERN_C const GUID DDPF_PMARGB32;") 
  1355.     cpp_quote("EXTERN_C const GUID DDPF_A1;") 
  1356.     cpp_quote("EXTERN_C const GUID DDPF_A2;") 
  1357.     cpp_quote("EXTERN_C const GUID DDPF_A4;") 
  1358.     cpp_quote("EXTERN_C const GUID DDPF_A8;") 
  1359.     cpp_quote("EXTERN_C const GUID DDPF_Z8;") 
  1360.     cpp_quote("EXTERN_C const GUID DDPF_Z16;") 
  1361.     cpp_quote("EXTERN_C const GUID DDPF_Z24;") 
  1362.     cpp_quote("EXTERN_C const GUID DDPF_Z32;") 
  1363.     cpp_quote("//")
  1364.     cpp_quote("//   Component categories")
  1365.     cpp_quote("//")
  1366.     cpp_quote("EXTERN_C const GUID CATID_DXImageTransform;")
  1367.     cpp_quote("EXTERN_C const GUID CATID_DX3DTransform;")
  1368.     cpp_quote("EXTERN_C const GUID CATID_DXAuthoringTransform;")
  1369.     cpp_quote("EXTERN_C const GUID CATID_DXSurface;")
  1370.     cpp_quote("//")
  1371.     cpp_quote("//   Service IDs")
  1372.     cpp_quote("//")
  1373.     cpp_quote("EXTERN_C const GUID SID_SDirectDraw;")
  1374.     cpp_quote("EXTERN_C const GUID SID_SDirect3DRM;")
  1375.     cpp_quote("#define SID_SDXTaskManager CLSID_DXTaskManager")
  1376.     cpp_quote("#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory")
  1377.     cpp_quote("#define SID_SDXTransformFactory IID_IDXTransformFactory")
  1378.  
  1379.     //=== Struct & Enum definitions =============================================
  1380.  
  1381.     //=== Interface definitions =================================================
  1382.  
  1383.  
  1384.     [
  1385.         uuid(17B59B2B-9CC8-11d1-9053-00C04FD9189D),
  1386.         helpstring("IDXBaseObject Interface"),
  1387.         pointer_default(unique)
  1388.     ]
  1389.     interface IDXBaseObject : IUnknown
  1390.     {
  1391.         HRESULT GetGenerationId( [out]ULONG *pID);
  1392.         HRESULT IncrementGenerationId([in] BOOL bRefresh);
  1393.         HRESULT GetObjectSize( [out] ULONG *pcbSize);
  1394.     }
  1395.  
  1396.     //--- Dimension identifiers
  1397.     typedef enum DXBNDID
  1398.     {
  1399.         DXB_X = 0,
  1400.         DXB_Y = 1,
  1401.         DXB_Z = 2,
  1402.         DXB_T = 3
  1403.     } DXBNDID;
  1404.  
  1405.     //--- Bound types
  1406.     typedef enum DXBNDTYPE
  1407.     {
  1408.         DXBT_DISCRETE,
  1409.         DXBT_DISCRETE64,
  1410.         DXBT_CONTINUOUS,
  1411.         DXBT_CONTINUOUS64
  1412.     } DXBNDTYPE;
  1413.  
  1414.     //--- Discrete bounds (image & sound)
  1415.     typedef struct DXDBND
  1416.     {
  1417.         long  Min;    
  1418.         long  Max;
  1419.     } DXDBND;
  1420.     typedef DXDBND DXDBNDS[4];
  1421.  
  1422.     typedef struct DXDBND64
  1423.     {
  1424.         LONGLONG Min;    
  1425.         LONGLONG Max;
  1426.     } DXDBND64;
  1427.     typedef DXDBND64 DXDBNDS64[4];
  1428.  
  1429.     //--- Continuous bounds (geometry)
  1430.     typedef struct DXCBND
  1431.     {
  1432.         float Min;    
  1433.         float Max;
  1434.     } DXCBND;
  1435.     typedef DXCBND DXCBNDS[4];
  1436.  
  1437.     typedef struct DXCBND64
  1438.     {
  1439.         double Min;    
  1440.         double Max;
  1441.     } DXCBND64;
  1442.     typedef DXCBND64 DXCBNDS64[4];
  1443.  
  1444.     //--- Combined space
  1445.     typedef union DXBNDS switch( DXBNDTYPE eType ) u
  1446.     {
  1447.       case DXBT_DISCRETE:
  1448.         DXDBND D[4];
  1449.       case DXBT_DISCRETE64:
  1450.         DXDBND64 LD[4];
  1451.       case DXBT_CONTINUOUS:
  1452.         DXCBND C[4];
  1453.       case DXBT_CONTINUOUS64:
  1454.         DXCBND64 LC[4];
  1455.     } DXBNDS;
  1456.  
  1457.     //--- Discrete 4D vector
  1458.     typedef long DXDVEC[4];
  1459.     typedef LONGLONG DXDVEC64[4];
  1460.  
  1461.     //--- Continous 4D vector
  1462.     typedef float DXCVEC[4];
  1463.     typedef double DXCVEC64[4];
  1464.  
  1465.     //--- Combined space vector
  1466.     typedef union DXVEC switch( DXBNDTYPE eType ) u
  1467.     {
  1468.       case DXBT_DISCRETE:
  1469.         long D[4];
  1470.       case DXBT_DISCRETE64:
  1471.         LONGLONG LD[4];
  1472.       case DXBT_CONTINUOUS:
  1473.         float C[4];
  1474.       case DXBT_CONTINUOUS64:
  1475.         double LC[4];
  1476.     } DXVEC;
  1477.  
  1478.     //--- IDXTransformFactory ---------------------------------------------------
  1479.     [
  1480.         uuid(6A950B2B-A971-11d1-81C8-0000F87557DB),
  1481.         helpstring("IDXTransformFactory Interface"),
  1482.         pointer_default(unique)
  1483.     ]
  1484.     interface IDXTransformFactory : IServiceProvider
  1485.     {
  1486.         HRESULT SetService( [in]REFGUID guidService, 
  1487.                             [in]IUnknown *pUnkService,
  1488.                             [in]BOOL bWeakReference);
  1489.  
  1490.         HRESULT CreateTransform( [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  1491.                                  [in]ULONG ulNumInputs,
  1492.                                  [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  1493.                                  [in]ULONG ulNumOutputs,
  1494.                                  [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog,
  1495.                                  [in]REFCLSID TransCLSID, [in]REFIID TransIID,
  1496.                                  [out, iid_is(TransIID)]void** ppTransform );
  1497.  
  1498.         HRESULT InitializeTransform( [in]IDXTransform* pTransform,
  1499.                                      [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  1500.                                      [in]ULONG ulNumInputs,
  1501.                                      [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  1502.                                      [in]ULONG ulNumOutputs,
  1503.                                      [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog );
  1504.     };
  1505.  
  1506.     //--- IDXTransform -------------------------------------------------
  1507.  
  1508.     typedef enum DXTMISCFLAGS
  1509.     {
  1510.         DXTMF_BLEND_WITH_OUTPUT   = ( 1L << 0 ),
  1511.         DXTMF_DITHER_OUTPUT       = ( 1L << 1 ),
  1512.         DXTMF_OPTION_MASK         = (0x0000FFFF),   // Low word is settable options
  1513.         DXTMF_VALID_OPTIONS       = (DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT),
  1514.         //
  1515.         //  Status flags can not be changed by call to SetMiscFlags
  1516.         //
  1517.         DXTMF_BLEND_SUPPORTED     = ( 1L << 16 ),
  1518.         DXTMF_DITHER_SUPPORTED    = ( 1L << 17 ),
  1519.         DXTMF_INPLACE_OPERATION   = ( 1L << 24 ),
  1520.         DXTMF_BOUNDS_SUPPORTED    = ( 1L << 25 ),
  1521.         DXTMF_PLACEMENT_SUPPORTED = ( 1L << 26 ),
  1522.         DXTMF_QUALITY_SUPPORTED   = ( 1L << 27 ),
  1523.         DXTMF_OPAQUE_RESULT       = ( 1L << 28 )
  1524.     } DXTMISCFLAGS;
  1525.  
  1526.  
  1527.     typedef enum DXINOUTINFOFLAGS
  1528.     {
  1529.         DXINOUTF_OPTIONAL = ( 1L << 0)
  1530.     } DXINOUTINFOFLAGS;
  1531.  
  1532.     [
  1533.         uuid(30A5FB78-E11F-11d1-9064-00C04FD9189D),
  1534.         helpstring("IDXTransform Interface"),
  1535.         pointer_default(unique)
  1536.     ]
  1537.     interface IDXTransform : IDXBaseObject
  1538.     {
  1539.         HRESULT Setup( [in, size_is(ulNumInputs)] IUnknown * const * punkInputs,
  1540.                        [in]ULONG ulNumInputs,
  1541.                        [in, size_is(ulNumOutputs)] IUnknown * const * punkOutputs,
  1542.                        [in]ULONG ulNumOutputs,
  1543.                        [in]DWORD dwFlags );
  1544.         HRESULT Execute( [in]const GUID* pRequestID, [in]const DXBNDS *pClipBnds,
  1545.                          [in]const DXVEC *pPlacement );
  1546.         HRESULT MapBoundsIn2Out( [in] const DXBNDS *pInBounds,
  1547.                                  [in]ULONG ulNumInBnds,
  1548.                                  [in]ULONG ulOutIndex,
  1549.                                  [out]DXBNDS *pOutBounds );
  1550.         HRESULT MapBoundsOut2In( [in] ULONG ulOutIndex,
  1551.                                  [in] const DXBNDS *pOutBounds,
  1552.                                  [in] ULONG ulInIndex,
  1553.                                  [out]DXBNDS *pInBounds );
  1554.         HRESULT SetMiscFlags( [in] DWORD dwMiscFlags);
  1555.         HRESULT GetMiscFlags( [out]DWORD * pdwMiscFlags );
  1556.         HRESULT GetInOutInfo( [in]BOOL bIsOutput, [in]ULONG ulIndex,
  1557.                               [out]DWORD *pdwFlags, [out, size_is(*pcIDs)] GUID *pIDs,
  1558.                               [in, out] ULONG *pcIDs,
  1559.                               [out] IUnknown **ppUnkCurrentObject);
  1560.         HRESULT SetQuality( [in] float fQuality );
  1561.         HRESULT GetQuality( [out] float * fQuality );
  1562.     };
  1563.  
  1564.  
  1565.     [
  1566.         uuid(30A5FB79-E11F-11d1-9064-00C04FD9189D),
  1567.         helpstring("IDXSurfacePick Interface"),
  1568.         pointer_default(unique)
  1569.     ]
  1570.     interface IDXSurfacePick : IUnknown
  1571.     {
  1572.         HRESULT PointPick([in]const DXVEC *pPoint,
  1573.                           [out]ULONG * pulInputSurfaceIndex,
  1574.                           [out]DXVEC *pInputPoint);
  1575.     }
  1576.  
  1577.  
  1578.     //--- IDXTBindHost ---------------------------------------------------
  1579.     //  This interface is used to set a site-specific bind host for a transform.
  1580.     //  Only transforms that need access to a bind host need to implement this interface.
  1581.  
  1582.     //
  1583.     //  For some reason, MIDL does not like IBindHost, so we've declared this interface local
  1584.     //
  1585.     [
  1586.         uuid(D26BCE55-E9DC-11d1-9066-00C04FD9189D),
  1587.         helpstring("IDXTBindHost Interface"),
  1588.         pointer_default(unique),
  1589.         local
  1590.     ]
  1591.     interface IDXTBindHost : IUnknown
  1592.     {
  1593.         HRESULT SetBindHost([in] IBindHost * pBindHost);
  1594.     }
  1595.  
  1596.     //--- IDXTaskManager ---------------------------------------------------
  1597.     // This interface is used to implement a task managment service provider
  1598.     // to optimize thread usage.
  1599.  
  1600.     // Function type prototypes
  1601.     typedef void (__stdcall DXTASKPROC)(void *pTaskData, BOOL* pbContinueProcessing );
  1602.     typedef DXTASKPROC *PFNDXTASKPROC;
  1603.  
  1604.     typedef void (__stdcall DXAPCPROC)(DWORD dwData);
  1605.     typedef DXAPCPROC *PFNDXAPCPROC;
  1606.  
  1607.     cpp_quote("#ifdef __cplusplus")
  1608.     cpp_quote("typedef struct DXTMTASKINFO" )
  1609.     cpp_quote("{")
  1610.     cpp_quote("    PFNDXTASKPROC pfnTaskProc;       // Pointer to function to execute")
  1611.     cpp_quote("    PVOID         pTaskData;         // Pointer to argument data")
  1612.     cpp_quote("    PFNDXAPCPROC  pfnCompletionAPC;  // Pointer to completion APC proc")
  1613.     cpp_quote("    DWORD         dwCompletionData;  // Pointer to APC proc data")
  1614.     cpp_quote("    const GUID*   pRequestID;        // Used to identify groups of tasks")
  1615.     cpp_quote("} DXTMTASKINFO;")
  1616.     cpp_quote("#else")
  1617.         typedef struct DXTMTASKINFO
  1618.         {
  1619.             PVOID       pfnTaskProc;       // Pointer to function to execute
  1620.             PVOID       pTaskData;         // Pointer to argument data
  1621.             PVOID       pfnCompletionAPC;  // Pointer to completion APC proc
  1622.             DWORD       dwCompletionData;  // Pointer to APC proc data
  1623.             const GUID* pRequestID;        // Used to identify groups of tasks
  1624.         } DXTMTASKINFO;
  1625.     cpp_quote("#endif")
  1626.  
  1627.     [
  1628.         local,
  1629.         uuid(254DBBC1-F922-11d0-883A-3C8B00C10000),
  1630.         helpstring("IDXTaskManager Interface"),
  1631.         pointer_default(unique)
  1632.     ]
  1633.     interface IDXTaskManager : IUnknown
  1634.     {
  1635.         HRESULT QueryNumProcessors( [out]ULONG* pulNumProc );
  1636.         HRESULT SetThreadPoolSize( [in]ULONG ulNumThreads );
  1637.         HRESULT GetThreadPoolSize( [out]ULONG* pulNumThreads );
  1638.         HRESULT SetConcurrencyLimit( [in]ULONG ulNumThreads );
  1639.         HRESULT GetConcurrencyLimit( [out]ULONG* pulNumThreads );
  1640.         HRESULT ScheduleTasks( [in]DXTMTASKINFO TaskInfo[],
  1641.                                [in]HANDLE Events[],
  1642.                                [out]DWORD TaskIDs[],
  1643.                                [in]ULONG ulNumTasks, [in]ULONG ulWaitPeriod );
  1644.         HRESULT TerminateTasks( [in]DWORD TaskIDs[], [in]ULONG ulCount,
  1645.                                 [in]ULONG ulTimeOut );
  1646.         HRESULT TerminateRequest( [in]REFIID RequestID, [in]ULONG ulTimeOut );
  1647.     };
  1648.  
  1649.     //--- IDXSurfaceFactory ---------------------------------------------------
  1650.     //
  1651.     //  We want an operator so that we can cast from a DXSAMPLE to a DWORD, so for C++ we will
  1652.     //  define the structure a special way.
  1653.     //
  1654.  
  1655.     cpp_quote("#ifdef __cplusplus")
  1656.     cpp_quote("/////////////////////////////////////////////////////")
  1657.     cpp_quote("")
  1658.     cpp_quote("class DXBASESAMPLE;")
  1659.     cpp_quote("class DXSAMPLE;")
  1660.     cpp_quote("class DXPMSAMPLE;")
  1661.     cpp_quote("")
  1662.     cpp_quote("/////////////////////////////////////////////////////")
  1663.     cpp_quote("")
  1664.     cpp_quote("class DXBASESAMPLE")
  1665.     cpp_quote("{")
  1666.     cpp_quote("public:")
  1667.     cpp_quote("    BYTE Blue;")
  1668.     cpp_quote("    BYTE Green;")
  1669.     cpp_quote("    BYTE Red;")
  1670.     cpp_quote("    BYTE Alpha;")
  1671.     cpp_quote("    DXBASESAMPLE() {}")
  1672.     cpp_quote("    DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  1673.     cpp_quote("        Alpha(alpha),")
  1674.     cpp_quote("        Red(red),")
  1675.     cpp_quote("        Green(green),")
  1676.     cpp_quote("        Blue(blue) {}")
  1677.     cpp_quote("    DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }")
  1678.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  1679.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); }")
  1680.     cpp_quote("}; // DXBASESAMPLE")
  1681.     cpp_quote("")
  1682.     cpp_quote("/////////////////////////////////////////////////////")
  1683.     cpp_quote("")
  1684.     cpp_quote("class DXSAMPLE : public DXBASESAMPLE")
  1685.     cpp_quote("{")
  1686.     cpp_quote("public:")
  1687.     cpp_quote("    DXSAMPLE() {}")
  1688.     cpp_quote("    DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  1689.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  1690.     cpp_quote("    DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); }")
  1691.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  1692.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); }")
  1693.     cpp_quote("    operator DXPMSAMPLE() const;")
  1694.     cpp_quote("}; // DXSAMPLE")
  1695.     cpp_quote("")
  1696.     cpp_quote("/////////////////////////////////////////////////////")
  1697.     cpp_quote("")
  1698.     cpp_quote("class DXPMSAMPLE : public DXBASESAMPLE")
  1699.     cpp_quote("{")
  1700.     cpp_quote("public:")
  1701.     cpp_quote("    DXPMSAMPLE() {}")
  1702.     cpp_quote("    DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  1703.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  1704.     cpp_quote("    DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); }")
  1705.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  1706.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); }")
  1707.     cpp_quote("    operator DXSAMPLE() const;")
  1708.     cpp_quote("}; // DXPMSAMPLE")
  1709.     cpp_quote("")
  1710.     cpp_quote("//")
  1711.     cpp_quote("// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE")
  1712.     cpp_quote("//")
  1713.     cpp_quote("inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); }")
  1714.     cpp_quote("inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); }")
  1715.  
  1716.     cpp_quote("#else // !__cplusplus")
  1717.     typedef struct DXBASESAMPLE
  1718.     {
  1719.         BYTE Blue;
  1720.         BYTE Green;
  1721.         BYTE Red; 
  1722.         BYTE Alpha;
  1723.     } DXBASESAMPLE;
  1724.  
  1725.     typedef struct DXSAMPLE
  1726.     {
  1727.         BYTE Blue;
  1728.         BYTE Green;
  1729.         BYTE Red; 
  1730.         BYTE Alpha;
  1731.     } DXSAMPLE;
  1732.  
  1733.     typedef struct DXPMSAMPLE
  1734.     {
  1735.         BYTE Blue;
  1736.         BYTE Green;
  1737.         BYTE Red; 
  1738.         BYTE Alpha;
  1739.     } DXPMSAMPLE;
  1740.     cpp_quote("#endif // !__cplusplus")
  1741.  
  1742.     typedef enum DXRUNTYPE
  1743.     {
  1744.         DXRUNTYPE_CLEAR  = 0,        // The run is zero Alpha
  1745.         DXRUNTYPE_OPAQUE = 1,        // The run is full Alpha (i.e. 255)
  1746.         DXRUNTYPE_TRANS  = 2,        // The run is non-zero Alpha
  1747.         DXRUNTYPE_UNKNOWN= 3         // The run type is unknown.  Caller must inspect.
  1748.     } DXRUNTYPE;
  1749.  
  1750.     const ULONG DX_MAX_RUN_INFO_COUNT = 128; // Defines the maximum number of RUNINFOs in a single row
  1751.  
  1752.  
  1753.     cpp_quote("// Ignore the definition used by MIDL for TLB generation")
  1754.     cpp_quote("#if 0")
  1755.  
  1756.     typedef struct DXRUNINFO
  1757.     {
  1758.         ULONG Bitfields;
  1759.     } DXRUNINFO;
  1760.  
  1761.     cpp_quote("#endif // 0")
  1762.  
  1763.     // Emit the C definition to the H file directly, as bit fields are not
  1764.     // supported by MIDL.
  1765.  
  1766.     cpp_quote("typedef struct DXRUNINFO")
  1767.     cpp_quote("{")
  1768.     cpp_quote("    ULONG   Type  : 2;   // Type")
  1769.     cpp_quote("    ULONG   Count : 30;  // Number of samples in run")
  1770.     cpp_quote("} DXRUNINFO;")
  1771.  
  1772.  
  1773.     typedef enum DXSFCREATE
  1774.     {
  1775.         DXSF_FORMAT_IS_CLSID    = ( 1L << 0 ),
  1776.         DXSF_NO_LAZY_DDRAW_LOCK = ( 1L << 1 )
  1777.     } DXSFCREATE;
  1778.  
  1779.     typedef enum DXBLTOPTIONS
  1780.     {
  1781.         DXBOF_DO_OVER          = (1L << 0),
  1782.         DXBOF_DITHER           = (1L << 1)
  1783.     } DXBLTOPTIONS;
  1784.  
  1785.  
  1786.  
  1787.     [
  1788.         uuid(144946F5-C4D4-11d1-81D1-0000F87557DB),
  1789.         helpstring("IDXSurfaceFactory Interface"),
  1790.         pointer_default(unique)
  1791.     ]
  1792.     interface IDXSurfaceFactory : IUnknown
  1793.     {
  1794.         [local] HRESULT CreateSurface([in] IUnknown *pDirectDraw,
  1795.                               [in] const DDSURFACEDESC * pDDSurfaceDesc,
  1796.                               [in] const GUID * pFormatID,
  1797.                               [in] const DXBNDS *pBounds, 
  1798.                               [in] DWORD dwFlags,
  1799.                               [in] IUnknown *punkOuter,
  1800.                               [in] REFIID riid, 
  1801.                               [out, iid_is( riid )] void ** ppDXSurface);
  1802.  
  1803.         HRESULT CreateFromDDSurface([in] IUnknown *pDDrawSurface,
  1804.                               [in] const GUID *pFormatID,
  1805.                               [in] DWORD dwFlags,
  1806.                               [in] IUnknown *punkOuter,
  1807.                               [in] REFIID riid, 
  1808.                               [out, iid_is( riid )] void ** ppDXSurface);
  1809.  
  1810.         [local] HRESULT LoadImage(
  1811.                               [in] const LPWSTR pszFileName,
  1812.                               [in] IUnknown *pDirectDraw,
  1813.                               [in] const DDSURFACEDESC * pDDSurfaceDesc,
  1814.                               [in] const GUID *pFormatID,
  1815.                               [in] REFIID riid, 
  1816.                               [out, iid_is( riid )] void ** ppDXSurface);
  1817.  
  1818.         [local] HRESULT LoadImageFromStream([in] IStream *pStream,
  1819.                                             [in] IUnknown *pDirectDraw,
  1820.                                             [in] const DDSURFACEDESC * pDDSurfaceDesc,
  1821.                                             [in] const GUID *pFormatID,
  1822.                                             [in] REFIID riid, 
  1823.                                             [out, iid_is( riid )] void ** ppDXSurface);
  1824.  
  1825.         [local] HRESULT CopySurfaceToNewFormat( [in]IDXSurface* pSrc,
  1826.                                                 [in] IUnknown *pDirectDraw,
  1827.                                                 [in] const DDSURFACEDESC * pDDSurfaceDesc,
  1828.                                                 [in] const GUID *pDestFormatID,
  1829.                                                 [out] IDXSurface** ppNewSurface );
  1830.  
  1831.         [local] HRESULT CreateD3DRMTexture([in] IDXSurface *pSrc,
  1832.                                            [in] IUnknown *pDirectDraw,
  1833.                                            [in] IUnknown *pD3DRM3,
  1834.                                            [in] REFIID riid,
  1835.                                            [out, iid_is(riid)] void **ppTexture3);
  1836.  
  1837.         HRESULT BitBlt([in] IDXSurface *pDest,
  1838.                        [in] const DXVEC *pPlacement,
  1839.                        [in] IDXSurface *pSrc,
  1840.                        [in] const DXBNDS *pClipBounds,
  1841.                        [in] DWORD dwFlags);
  1842.     }
  1843.  
  1844.  
  1845.     typedef enum DXSURFMODCOMPOP
  1846.     {
  1847.         DXSURFMOD_COMP_OVER         = 0,
  1848.         DXSURFMOD_COMP_ALPHA_MASK   = 1,
  1849.         DXSURFMOD_COMP_MAX_VALID    = 1
  1850.     } DXSURFMODCOMPOP;
  1851.  
  1852.     
  1853.     [
  1854.         uuid(9EA3B637-C37D-11d1-905E-00C04FD9189D),
  1855.         helpstring("IDXSurfaceModifier Interface"),
  1856.         pointer_default(unique)
  1857.     ]
  1858.     interface IDXSurfaceModifier : IUnknown
  1859.     {
  1860.         HRESULT SetFillColor([in] DXSAMPLE Color);
  1861.         HRESULT GetFillColor([out] DXSAMPLE *pColor);
  1862.         HRESULT SetBounds([in] const DXBNDS *pBounds ); // Get supported though IDXSurface interface
  1863.         HRESULT SetBackground([in] IDXSurface *pSurface);
  1864.         HRESULT GetBackground([out] IDXSurface **ppSurface);
  1865.         HRESULT SetCompositeOperation([in] DXSURFMODCOMPOP CompOp);
  1866.         HRESULT GetCompositeOperation([out] DXSURFMODCOMPOP *pCompOp);
  1867.         //
  1868.         //  The following methods only apply to the FOREGROUND surface
  1869.         //
  1870.         HRESULT SetForeground([in] IDXSurface *pSurface, [in] BOOL bTile, [in] const POINT * pOrigin);
  1871.         HRESULT GetForeground([out] IDXSurface **ppSurface, [out] BOOL *pbTile, [out] POINT * pOrigin);
  1872.         HRESULT SetOpacity([in] float Opacity);
  1873.         HRESULT GetOpacity([out] float *pOpacity);    
  1874.         HRESULT SetLookup( [in]IDXLookupTable * pLookupTable );
  1875.         HRESULT GetLookup( [out]IDXLookupTable ** ppLookupTable );
  1876.     }
  1877.  
  1878.  
  1879.  
  1880.     //--- IDXSurface ---------------------------------------------------
  1881.     typedef enum DXSAMPLEFORMATENUM
  1882.     {
  1883.         DXPF_FLAGSMASK      = (0xFFFF0000), // Top word is flags, low word is enum  
  1884.         DXPF_NONPREMULT     = (0x00010000), // Flags to be OR'd with pixel formats
  1885.         DXPF_TRANSPARENCY   = (0x00020000), // Color key or one-bit alpha (alpha only 0 or 0xFF)
  1886.         DXPF_TRANSLUCENCY   = (0x00040000), // Alpha can be any value from 0->0xFF
  1887.         //
  1888.         //  This 3-bit field is used to determine what type of dithering to be used
  1889.         //  
  1890.         DXPF_2BITERROR      = (0x00200000), // 2 bits of error term 
  1891.         DXPF_3BITERROR      = (0x00300000), // 3 bits of error term for color (16-bit color)
  1892.         DXPF_4BITERROR      = (0x00400000), // 4 bits of error term (ARGB 4444)
  1893.         DXPF_5BITERROR      = (0x00500000), // 5 bits of error term for color (8-bit color)
  1894.         DXPF_ERRORMASK      = (0x00700000), // Mask of bits used for dithering
  1895.  
  1896.         DXPF_NONSTANDARD    = (0),  // To be used for any surface that is not one of the following formats
  1897.                                     // This can be combined with DXPFNONPREMULT if the surface can work
  1898.                                     // better in non-premultiplied space.
  1899.         DXPF_PMARGB32       = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  1900.         DXPF_ARGB32         = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  1901.         DXPF_ARGB4444       = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR),
  1902.         DXPF_A8             = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  1903.         DXPF_RGB32          = (5),
  1904.         DXPF_RGB24          = (6),
  1905.         DXPF_RGB565         = (7 | DXPF_3BITERROR),
  1906.         DXPF_RGB555         = (8 | DXPF_3BITERROR),
  1907.         DXPF_RGB8           = (9 | DXPF_5BITERROR),
  1908.         DXPF_ARGB1555       = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR),
  1909.         DXPF_RGB32_CK       = (DXPF_RGB32 | DXPF_TRANSPARENCY),
  1910.         DXPF_RGB24_CK       = (DXPF_RGB24 | DXPF_TRANSPARENCY),
  1911.         DXPF_RGB555_CK      = (DXPF_RGB555 | DXPF_TRANSPARENCY),
  1912.         DXPF_RGB565_CK      = (DXPF_RGB565 | DXPF_TRANSPARENCY),
  1913.         DXPF_RGB8_CK        = (DXPF_RGB8 | DXPF_TRANSPARENCY)
  1914.     } DXSAMPLEFORMATENUM;
  1915.  
  1916.  
  1917.  
  1918.     typedef enum DXLOCKSURF
  1919.     {
  1920.         DXLOCKF_READ        =       0,
  1921.         DXLOCKF_READWRITE   =       (1 << 0),
  1922.         DXLOCKF_EXISTINGINFOONLY =  (1 << 1),   // If used in conjunction with WANTRUNINFO will prevent creation of a runmap if one does not exist
  1923.         DXLOCKF_WANTRUNINFO =       (1 << 2),
  1924.         //
  1925.         // The flags in the high word should be specific to the type of pointer that
  1926.         // is requested.  These flags define ARGB flags.  These flags are advisory and
  1927.         // are not required to be set for ARGB locks.
  1928.         //
  1929.         DXLOCKF_NONPREMULT  =   (1 << 16),    // Caller will request non-premultiplied data
  1930.         DXLOCKF_VALIDFLAGS  =   (DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT)
  1931.     } DXLOCKSURF;
  1932.  
  1933.     typedef enum DXSURFSTATUS
  1934.     {
  1935.         DXSURF_TRANSIENT    =   (1 << 0),   // Data in this surface changes often.    
  1936.         DXSURF_READONLY     =   (1 << 1),   // Surface is read-only
  1937.         DXSURF_VALIDFLAGS   =   (DXSURF_TRANSIENT | DXSURF_READONLY)    
  1938.     } DXSURFSTATUS;
  1939.  
  1940.     [
  1941.         uuid(B39FD73F-E139-11d1-9065-00C04FD9189D),
  1942.         helpstring("IDXSurface Interface"),
  1943.         pointer_default(unique)
  1944.     ]
  1945.     interface IDXSurface : IDXBaseObject
  1946.     {
  1947.         HRESULT GetPixelFormat([out] GUID * pFormatID, [out] DXSAMPLEFORMATENUM *pSampleFormatEnum); 
  1948.         HRESULT GetBounds( [out]DXBNDS *pBounds );
  1949.         HRESULT GetStatusFlags([out] DWORD * pdwStatusFlags);
  1950.         HRESULT SetStatusFlags([in] DWORD dwStatusFlags);
  1951.         HRESULT LockSurface( [in]const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in]DWORD dwFlags, 
  1952.                              [in]REFIID riid, [out, iid_is(riid)] void **ppPointer,
  1953.                              [out]ULONG* pulGenerationId );
  1954.         HRESULT GetDirectDrawSurface( [in] REFIID riid,
  1955.                                       [out, iid_is(riid)] void ** ppSurface);
  1956.         HRESULT GetColorKey(DXSAMPLE * pColorKey);  // Can return E_NOTIMPL
  1957.         HRESULT SetColorKey(DXSAMPLE ColorKey);     // Set color of 0 to get rid of color key, can return E_NOTIMPL
  1958.         HRESULT LockSurfaceDC( [in] const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in] DWORD dwFlags,
  1959.                                [out] IDXDCLock **ppDCLock);
  1960.         HRESULT SetAppData(DWORD_PTR dwAppData);
  1961.         HRESULT GetAppData(DWORD_PTR *pdwAppData);
  1962.     }
  1963.  
  1964.     //--- IDXSurfaceInit ---------------------------------------------------
  1965.     [
  1966.         uuid(9EA3B639-C37D-11d1-905E-00C04FD9189D),
  1967.         helpstring("IDXSurfaceInit Interface"),
  1968.         pointer_default(unique),
  1969.         local
  1970.     ]
  1971.     interface IDXSurfaceInit : IUnknown
  1972.     {
  1973.         HRESULT InitSurface([in] IUnknown *pDirectDraw,
  1974.                             [in] const DDSURFACEDESC *pDDSurfaceDesc,
  1975.                             [in] const GUID * pFormatID,
  1976.                             [in] const DXBNDS *pBounds,
  1977.                             [in] DWORD dwFlags);
  1978.     };
  1979.  
  1980.  
  1981.     //--- IDXARGBSurfaceInit ---------------------------------------------------
  1982.     [
  1983.         uuid(9EA3B63A-C37D-11d1-905E-00C04FD9189D),
  1984.         helpstring("IDXARGBSurfaceInit Interface"),
  1985.         pointer_default(unique),
  1986.         local
  1987.     ]
  1988.     interface IDXARGBSurfaceInit : IDXSurfaceInit
  1989.     {
  1990.         HRESULT InitFromDDSurface( [in] IUnknown *pDDrawSurface,
  1991.                                    [in] const GUID * pFormatID,
  1992.                                    [in] DWORD dwFlags);
  1993.         HRESULT InitFromRawSurface([in] IDXRawSurface *pRawSurface);
  1994.     };
  1995.  
  1996.     //--- IDXARGBReadPtr ---------------------------------------------------
  1997.     typedef struct tagDXNATIVETYPEINFO
  1998.     {
  1999.         BYTE *          pCurrentData;
  2000.         BYTE *          pFirstByte;
  2001.         long            lPitch;
  2002.         DWORD           dwColorKey;
  2003.     } DXNATIVETYPEINFO;
  2004.  
  2005.     typedef struct tagDXPACKEDRECTDESC
  2006.     {
  2007.         DXBASESAMPLE    *pSamples;
  2008.         BOOL            bPremult;
  2009.         RECT            rect;
  2010.         long            lRowPadding;
  2011.     } DXPACKEDRECTDESC;
  2012.  
  2013.     typedef struct tagDXOVERSAMPLEDESC
  2014.     {
  2015.         POINT       p;
  2016.         DXPMSAMPLE  Color;
  2017.     } DXOVERSAMPLEDESC;
  2018.         
  2019.  
  2020.     [
  2021.         uuid(EAAAC2D6-C290-11d1-905D-00C04FD9189D),
  2022.         helpstring("IDXARGBReadPtr Interface"),
  2023.         pointer_default(unique),
  2024.         local
  2025.     ]
  2026.     interface IDXARGBReadPtr : IUnknown
  2027.     {
  2028.         HRESULT GetSurface( [in]REFIID riid, [out, iid_is( riid )]void ** ppSurface);
  2029.         DXSAMPLEFORMATENUM GetNativeType( [out]DXNATIVETYPEINFO *pInfo );
  2030.         void Move( [in]long cSamples );
  2031.         void MoveToRow( [in]ULONG y );
  2032.         void MoveToXY( [in]ULONG x, [in]ULONG y);
  2033.         ULONG MoveAndGetRunInfo( [in]ULONG Row, [out] const DXRUNINFO** ppInfo );  // Returns count of runs
  2034.         DXSAMPLE   * Unpack( [in]DXSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  2035.         DXPMSAMPLE * UnpackPremult( [in]DXPMSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  2036.         void UnpackRect([in] const DXPACKEDRECTDESC * pRectDesc);
  2037.     };
  2038.  
  2039.  
  2040.     //--- IDXARGBReadWritePtr ---------------------------------------------------
  2041.     [
  2042.         uuid(EAAAC2D7-C290-11d1-905D-00C04FD9189D),
  2043.         helpstring("IDXARGBReadWritePtr Interface"),
  2044.         pointer_default(unique),
  2045.         local
  2046.     ]
  2047.     interface IDXARGBReadWritePtr : IDXARGBReadPtr
  2048.     {
  2049.         void PackAndMove( [in]const DXSAMPLE *pSamples, [in]ULONG cSamples );
  2050.         void PackPremultAndMove( [in]const DXPMSAMPLE *pSamples, [in]ULONG cSamples );
  2051.         void PackRect([in]const DXPACKEDRECTDESC *pRectDesc);
  2052.         void CopyAndMoveBoth( [in]DXBASESAMPLE *pScratchBuffer, [in]IDXARGBReadPtr *pSrc,
  2053.                               [in]ULONG cSamples, [in]BOOL bIsOpaque );
  2054.         void CopyRect( [in] DXBASESAMPLE *pScratchBuffer, 
  2055.                        [in] const RECT *pDestRect, [in]IDXARGBReadPtr *pSrc,
  2056.                        [in] const POINT *pSrcOrigin, [in]BOOL bIsOpaque);
  2057.         void FillAndMove( [in]DXBASESAMPLE *pScratchBuffer, [in]DXPMSAMPLE SampVal,
  2058.                           [in]ULONG cSamples, [in]BOOL bDoOver );
  2059.         void FillRect( [in]const RECT *pRect, [in]DXPMSAMPLE SampVal, [in]BOOL bDoOver );
  2060.         void OverSample( [in]const DXOVERSAMPLEDESC * pOverDesc);
  2061.         void OverArrayAndMove([in]DXBASESAMPLE *pScratchBuffer, 
  2062.                               [in] const DXPMSAMPLE *pSrc,
  2063.                               [in] ULONG cSamples);
  2064.     };
  2065.  
  2066.  
  2067.     [
  2068.         uuid(0F619456-CF39-11d1-905E-00C04FD9189D),
  2069.         helpstring("IDXDCLock Interface"),
  2070.         pointer_default(unique),
  2071.         local
  2072.     ]
  2073.     interface IDXDCLock : IUnknown
  2074.     {
  2075.         HDC GetDC(void);
  2076.     }
  2077.  
  2078.     //
  2079.     //  Generic interface that any transform can support which allows caller to specify the
  2080.     //  desired output bounds.
  2081.     //
  2082.     [
  2083.         uuid(B2024B50-EE77-11d1-9066-00C04FD9189D),
  2084.         helpstring("IDXTScaleOutput Interface"),
  2085.         pointer_default(unique)
  2086.     ]
  2087.     interface IDXTScaleOutput : IUnknown
  2088.     {
  2089.         HRESULT SetOutputSize([in] const SIZE OutSize, [in] BOOL bMaintainAspect);
  2090.     };
  2091.  
  2092.  
  2093.     //
  2094.     //  Simple gradient
  2095.     //
  2096.     [
  2097.         uuid(B2024B51-EE77-11d1-9066-00C04FD9189D),
  2098.         helpstring("IDXGradient Interface"),
  2099.         pointer_default(unique)
  2100.     ]
  2101.     interface IDXGradient : IDXTScaleOutput
  2102.     {
  2103.         HRESULT SetGradient(DXSAMPLE StartColor, DXSAMPLE EndColor, BOOL bHorizontal);
  2104.         HRESULT GetOutputSize([out] SIZE *pOutSize);
  2105.     };
  2106.  
  2107.     //--- IDXTScale --------------------------------------------------------
  2108.     // This is the control interface for the simple scale transform
  2109.     //
  2110.     [
  2111.         uuid(B39FD742-E139-11d1-9065-00C04FD9189D),
  2112.         helpstring("IDXTScale Interface"),
  2113.         pointer_default(unique)
  2114.     ]
  2115.     interface IDXTScale : IUnknown
  2116.     {
  2117.         HRESULT SetScales( [in]float Scales[2] );
  2118.         HRESULT GetScales( [out]float Scales[2] );
  2119.         HRESULT ScaleFitToSize( [in,out]DXBNDS* pClipBounds,
  2120.                                 [in]SIZE FitToSize, [in]BOOL bMaintainAspect );
  2121.     };
  2122.  
  2123.  
  2124.  
  2125.     //--- IDXEffect -------------------------------------------------
  2126.     //  This interface is used to generically control transforms that
  2127.     //  are transition effects.
  2128.     typedef enum DISPIDDXEFFECT
  2129.     {
  2130.         DISPID_DXECAPABILITIES = 10000, // Start at 10000 to avoid conflicts with inhereted interfaces
  2131.         DISPID_DXEPROGRESS,
  2132.         DISPID_DXESTEP,
  2133.         DISPID_DXEDURATION,
  2134.         DISPID_DXE_NEXT_ID
  2135.     } DISPIDDXBOUNDEDEFFECT;
  2136.  
  2137.     typedef enum DXEFFECTTYPE
  2138.     {
  2139.         DXTET_PERIODIC = (1 << 0),  // Result at 1 is same as result at 0
  2140.         DXTET_MORPH = (1 << 1)      // Transition between 2 inputs (input 0 to input 1)
  2141.     } DXEFFECTTYPE;
  2142.  
  2143.  
  2144.  
  2145.  
  2146.     [
  2147.         object,
  2148.         uuid(E31FB81B-1335-11d1-8189-0000F87557DB),
  2149.         dual,
  2150.         helpstring("IDXEffect Interface"),
  2151.         pointer_default(unique)
  2152.     ]
  2153.     interface IDXEffect : IDispatch
  2154.     {
  2155.         [propget, id(DISPID_DXECAPABILITIES)]
  2156.             HRESULT Capabilities([out, retval] long *pVal);
  2157.         [propget, id(DISPID_DXEPROGRESS)]
  2158.             HRESULT Progress([out, retval] float *pVal);
  2159.         [propput, id(DISPID_DXEPROGRESS)]
  2160.             HRESULT Progress([in] float newVal);
  2161.         [propget, id(DISPID_DXESTEP)]
  2162.             HRESULT StepResolution([out, retval] float *pVal);
  2163.         [propget, id(DISPID_DXEDURATION)]
  2164.             HRESULT Duration([out, retval] float *pVal);
  2165.         [propput, id(DISPID_DXEDURATION)]
  2166.             HRESULT Duration([in] float newVal);
  2167.     };
  2168.  
  2169.     //--- IDXLookupTable ---------------------------------------------
  2170.     [
  2171.         uuid(01BAFC7F-9E63-11d1-9053-00C04FD9189D),
  2172.         helpstring("IDXLookupTable Interface"),
  2173.         pointer_default(unique)
  2174.     ]
  2175.     interface IDXLookupTable : IDXBaseObject
  2176.     {
  2177.         HRESULT GetTables( [out]BYTE RedLUT[256],
  2178.                            [out]BYTE GreenLUT[256],
  2179.                            [out]BYTE BlueLUT[256],
  2180.                            [out]BYTE AlphaLUT[256] );
  2181.  
  2182.         HRESULT IsChannelIdentity([out] DXBASESAMPLE * pSampleBools);
  2183.         HRESULT GetIndexValues([in] ULONG Index, [out] DXBASESAMPLE *pSample);
  2184.         HRESULT ApplyTables([in, out] DXSAMPLE *pSamples, [in] ULONG cSamples);
  2185.     };
  2186.  
  2187.  
  2188.  
  2189.     typedef struct DXRAWSURFACEINFO
  2190.     {
  2191.         BYTE        * pFirstByte;
  2192.         long        lPitch;
  2193.         ULONG       Width;
  2194.         ULONG       Height;
  2195.         const GUID  * pPixelFormat;
  2196.         HDC         hdc;
  2197.         DWORD       dwColorKey;     // Note:  High byte must == 0xFF for color keyed surface.  Low 3 bytes are native data type.
  2198.         DXBASESAMPLE * pPalette;
  2199.     } DXRAWSURFACEINFO;
  2200.  
  2201.     //
  2202.     //  User created objects support IDXRawSurface
  2203.     //
  2204.  
  2205.     [
  2206.         uuid(09756C8A-D96A-11d1-9062-00C04FD9189D),
  2207.         helpstring("IDXRawSurface Interface"),
  2208.         pointer_default(unique),
  2209.         local
  2210.     ]
  2211.     interface IDXRawSurface : IUnknown
  2212.     {
  2213.         HRESULT GetSurfaceInfo(DXRAWSURFACEINFO * pSurfaceInfo);
  2214.     }
  2215.  
  2216.  
  2217.     //+-----------------------------------------------------------------------------
  2218.     //
  2219.     //  IHTMLDXTransform
  2220.     //
  2221.     //------------------------------------------------------------------------------
  2222.  
  2223.     [
  2224.         uuid(30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5),
  2225.         helpstring("IHTMLDXTransform Interface"),
  2226.         pointer_default(unique),
  2227.         local
  2228.     ]
  2229.     interface IHTMLDXTransform : IUnknown
  2230.     {
  2231.         HRESULT SetHostUrl(BSTR bstrHostUrl);
  2232.     }
  2233.  
  2234.  
  2235.     //=== CoClass definitions =================================================
  2236.  
  2237.     [
  2238.         uuid(54314D1D-35FE-11d1-81A1-0000F87557DB),
  2239.         version(1.0),
  2240.         helpstring("Microsoft DirectX Transform 1.0 Type Library")
  2241.     ]
  2242.     library DXTRANSLib
  2243.     {
  2244.         importlib("stdole32.tlb");
  2245.         importlib("stdole2.tlb");
  2246.  
  2247.         ///////////////////////////////
  2248.         // DXTransformFactory CoClass
  2249.         ///////////////////////////////
  2250.         [
  2251.             uuid(D1FE6762-FC48-11D0-883A-3C8B00C10000),
  2252.             helpstring("DXTransformFactory Class")
  2253.         ]
  2254.         coclass DXTransformFactory
  2255.         {
  2256.             [default] interface IDXTransformFactory;
  2257.             interface IDXSurfaceFactory;
  2258.         };
  2259.  
  2260.         ///////////////////////////////
  2261.         // DXTaskManager CoClass
  2262.         ///////////////////////////////
  2263.         [
  2264.             uuid(4CB26C03-FF93-11d0-817E-0000F87557DB),
  2265.             helpstring("DXTaskManager Class")
  2266.         ]
  2267.         coclass DXTaskManager
  2268.         {
  2269.             [default] interface IDXTaskManager;
  2270.         };
  2271.  
  2272.         ///////////////////////////////
  2273.         // DXTScale CoClass
  2274.         ///////////////////////////////
  2275.         [
  2276.             uuid(555278E2-05DB-11D1-883A-3C8B00C10000),
  2277.             helpstring("DXTScale Class")
  2278.         ]
  2279.         coclass DXTScale
  2280.         {
  2281.             [default] interface IDXTScale;
  2282.         };
  2283.  
  2284.         ///////////////////////////////
  2285.         // DXSurface CoClass
  2286.         ///////////////////////////////
  2287.         [
  2288.         uuid(0E890F83-5F79-11D1-9043-00C04FD9189D),
  2289.         helpstring("DXSurface Class")
  2290.         ]
  2291.         coclass DXSurface
  2292.         {
  2293.         [default] interface IDXSurface;
  2294.         };
  2295.  
  2296.         ///////////////////////////////
  2297.         // DXSurfaceModifier CoClass
  2298.         ///////////////////////////////
  2299.         [
  2300.         uuid(3E669F1D-9C23-11d1-9053-00C04FD9189D),
  2301.         helpstring("DXSurfaceModifier Class")
  2302.         ]
  2303.         coclass DXSurfaceModifier
  2304.         {
  2305.         [default] interface IDXSurfaceModifier;
  2306.         };
  2307.  
  2308.         ///////////////////////////////
  2309.         // DXGradient CoClass
  2310.         ///////////////////////////////
  2311.         [
  2312.         uuid(C6365470-F667-11d1-9067-00C04FD9189D),
  2313.         helpstring("DXGradient Class")
  2314.         ]
  2315.         coclass DXGradient
  2316.         {
  2317.             [default] interface IDXGradient;
  2318.         };
  2319.     };
  2320.  
  2321.  
  2322. #endif    // DirectX 8.0 content